rlp: optimize byte array handling (#22924)
This change improves the performance of encoding/decoding [N]byte. name old time/op new time/op delta DecodeByteArrayStruct-8 336ns ± 0% 246ns ± 0% -26.98% (p=0.000 n=9+10) EncodeByteArrayStruct-8 225ns ± 1% 148ns ± 1% -34.12% (p=0.000 n=10+10) name old alloc/op new alloc/op delta DecodeByteArrayStruct-8 120B ± 0% 48B ± 0% -60.00% (p=0.000 n=10+10) EncodeByteArrayStruct-8 0.00B 0.00B ~ (all equal)
Showing
- rlp/decode.go 7 additions, 9 deletionsrlp/decode.go
- rlp/decode_test.go 42 additions, 2 deletionsrlp/decode_test.go
- rlp/encode.go 17 additions, 39 deletionsrlp/encode.go
- rlp/encode_test.go 19 additions, 0 deletionsrlp/encode_test.go
- rlp/safe.go 26 additions, 0 deletionsrlp/safe.go
- rlp/unsafe.go 35 additions, 0 deletionsrlp/unsafe.go
Loading
Please register or sign in to comment