We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Currently, marshaling a 24 byte via binary allocates quite a lot:
binary
name time/op Marshalling/reflection-8 1.27µs ± 8% Marshalling/custom-8 730ns ± 6% Marshalling/unsafe-8 662ns ± 5% name alloc/op Marshalling/reflection-8 152B ± 0% Marshalling/custom-8 32.0B ± 0% Marshalling/unsafe-8 0.00B name allocs/op Marshalling/reflection-8 8.00 ± 0% Marshalling/custom-8 1.00 ± 0% Marshalling/unsafe-8 0.00
Cilium proper has a patched binary package which reduces allocations: https://github.com/cilium/cilium/tree/master/pkg/bpf/binary
The text was updated successfully, but these errors were encountered:
I managed to improve the performance of binary.Read and Write for structs. Improvement of go tip over 1.13:
name old time/op new time/op delta Marshalling/reflection 1.24µs ± 1% 1.00µs ± 1% -19.38% (p=0.008 n=5+5) name old alloc/op new alloc/op delta Marshalling/reflection 152B ± 0% 112B ± 0% -26.32% (p=0.008 n=5+5) name old allocs/op new allocs/op delta Marshalling/reflection 8.00 ± 0% 3.00 ± 0% -62.50% (p=0.008 n=5+5)
See golang/go#34471
Sorry, something went wrong.
Is there anything else to do here? It seems @lmb's performance improvement made it upstream (golang/go@c9d89f6) and will be part of Go 1.14.
I'm happy to close this as a wontfix. If cilium needs more perf you can implement BinaryMarshaler, or use unsafe.Pointer for every last drop.
No branches or pull requests
Currently, marshaling a 24 byte via
binary
allocates quite a lot:Cilium proper has a patched binary package which reduces allocations: https://github.com/cilium/cilium/tree/master/pkg/bpf/binary
The text was updated successfully, but these errors were encountered: