-
Notifications
You must be signed in to change notification settings - Fork 20
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
Re-run benchmarks with recent Go version #2
Comments
I have checked a recent version of go 1.14 (commit "old" is
|
Data initialization ( |
Can you even reuse a structure like that? Does Unmarshal clear/zero omitted fields for example? |
I'm not sure about the zeroing of omitted fields in consecutive calls of Unmarshal with the same variable. I think, however, that reusing a variable is a realistic use case, since the test-suit of Here is the same comparison, when re-initializing the target every iteration (you can find the code here):
|
go1.19.13, Considering GC factors, jsoniter is no longer as good as encoding/json. bench code: https://github.com/win5do/play-go/blob/0c79bdc76dd37be3db9fc69df20c2a922a11ae49/bench/json/bench_test.go goos: darwin
goarch: arm64
pkg: play-go/bench/json
│ std │ jtr │
│ sec/op │ sec/op vs base │
Unmarshal 1.954µ ± 4% 1.416µ ± 1% -27.54% (p=0.000 n=10)
│ std │ jtr │
│ B/op │ B/op vs base │
Unmarshal 1.376Ki ± 0% 1.360Ki ± 0% -1.14% (p=0.000 n=10)
│ std │ jtr │
│ allocs/op │ allocs/op vs base │
Unmarshal 29.00 ± 0% 34.00 ± 0% +17.24% (p=0.000 n=10)
---
goos: darwin
goarch: arm64
pkg: play-go/bench/json
│ std │ jtr │
│ sec/op │ sec/op vs base │
Unmarshal 17.01µ ± 1% 11.22µ ± 2% -34.03% (p=0.000 n=10)
│ std │ jtr │
│ B/op │ B/op vs base │
Unmarshal 10.10Ki ± 0% 10.99Ki ± 0% +8.86% (p=0.000 n=10)
│ std │ jtr │
│ allocs/op │ allocs/op vs base │
Unmarshal 205.0 ± 0% 268.0 ± 0% +30.73% (p=0.000 n=10)
---
goos: darwin
goarch: arm64
pkg: play-go/bench/json
│ std │ jtr │
│ sec/op │ sec/op vs base │
Unmarshal 241.3µ ± 1% 192.6µ ± 2% -20.19% (p=0.000 n=10)
│ std │ jtr │
│ B/op │ B/op vs base │
Unmarshal 204.5Ki ± 0% 223.4Ki ± 0% +9.28% (p=0.000 n=10)
│ std │ jtr │
│ allocs/op │ allocs/op vs base │
Unmarshal 2.783k ± 0% 3.901k ± 0% +40.17% (p=0.000 n=10) |
Go version 1.11 includes cl47152 and cl98440. The changes when compared to Go version 1.10 are significant.
The text was updated successfully, but these errors were encountered: