-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
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
Speedup stackitem json serialization #2053
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little worried about our test coverage after these changes. Do we hit every corner case with our current test set? But it looks good otherwise.
Codecov Report
@@ Coverage Diff @@
## master #2053 +/- ##
==========================================
+ Coverage 83.15% 84.34% +1.19%
==========================================
Files 287 287
Lines 23419 26939 +3520
==========================================
+ Hits 19473 22722 +3249
- Misses 2736 2991 +255
- Partials 1210 1226 +16
Continue to review full report at Codecov.
|
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
``` name old time/op new time/op delta ToJSON-8 4.52ms ± 4% 0.05ms ±34% -98.89% (p=0.000 n=8+10) name old alloc/op new alloc/op delta ToJSON-8 2.13MB ± 0% 0.40MB ± 0% -81.44% (p=0.000 n=9+6) name old allocs/op new allocs/op delta ToJSON-8 65.6k ± 0% 0.0k ± 0% -99.95% (p=0.000 n=10+10) ``` Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
``` name old time/op new time/op delta ToJSON-8 50.3µs ±34% 47.8µs ± 9% ~ (p=0.971 n=10+10) name old alloc/op new alloc/op delta ToJSON-8 396kB ± 0% 396kB ± 0% -0.10% (p=0.000 n=6+10) name old allocs/op new allocs/op delta ToJSON-8 34.0 ± 0% 18.0 ± 0% -47.06% (p=0.000 n=10+10) ``` Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
``` name old time/op new time/op delta EncodeBinary-8 10.6ms ± 1% 8.4ms ± 1% -20.94% (p=0.000 n=9+10) name old alloc/op new alloc/op delta EncodeBinary-8 1.64MB ± 0% 2.24MB ± 0% +36.18% (p=0.000 n=8+9) name old allocs/op new allocs/op delta EncodeBinary-8 131k ± 0% 66k ± 0% -49.98% (p=0.000 n=10+10) ``` Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
``` name old time/op new time/op delta EncodeBinary-8 8.39ms ± 1% 0.05ms ±21% -99.44% (p=0.000 n=10+9) name old alloc/op new alloc/op delta EncodeBinary-8 2.24MB ± 0% 0.33MB ± 0% -85.29% (p=0.000 n=9+10) name old allocs/op new allocs/op delta EncodeBinary-8 65.6k ± 0% 0.0k ± 0% -99.95% (p=0.000 n=10+10) ``` Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
Cache already marshaled values.
The expected memory overhead is linear (map itself + living references to the old buffer memory in case it grows with reallocation).