Closed ernado closed 2 years ago
I will update the README for relevant releases
I've also optimized withpath
case, reducing allocations
goos: linux
goarch: amd64
pkg: github.com/romshark/jscan
cpu: AMD Ryzen 9 5950X 16-Core Processor
BenchmarkCalcStats/jscan/tiny-32 97140116 64.14 ns/op 0 B/op 0 allocs/op
BenchmarkCalcStats/jscan/small-32 10741642 570.6 ns/op 0 B/op 0 allocs/op
BenchmarkCalcStats/jscan/large-32 199 29671587 ns/op 55 B/op 0 allocs/op
BenchmarkCalcStats/jsoniter/tiny-32 36711424 165.5 ns/op 160 B/op 2 allocs/op
BenchmarkCalcStats/jsoniter/small-32 4007560 1455 ns/op 224 B/op 12 allocs/op
BenchmarkCalcStats/jsoniter/large-32 55 107943327 ns/op 33060242 B/op 1108611 allocs/op
BenchmarkCalcStats/gofaster-jx/tiny-32 115848550 50.53 ns/op 0 B/op 0 allocs/op
BenchmarkCalcStats/gofaster-jx/small-32 10810816 524.3 ns/op 0 B/op 0 allocs/op
BenchmarkCalcStats/gofaster-jx/large-32 228 26376531 ns/op 18 B/op 0 allocs/op
BenchmarkCalcStats/jscan_withpath/tiny-32 84674761 71.11 ns/op 0 B/op 0 allocs/op
BenchmarkCalcStats/jscan_withpath/small-32 7394097 782.8 ns/op 0 B/op 0 allocs/op
BenchmarkCalcStats/jscan_withpath/large-32 171 34641307 ns/op 65 B/op 0 allocs/op
BenchmarkCalcStats/jsoniter_withpath/tiny-32 29611117 198.8 ns/op 160 B/op 2 allocs/op
BenchmarkCalcStats/jsoniter_withpath/small-32 2720352 2186 ns/op 288 B/op 21 allocs/op
BenchmarkCalcStats/jsoniter_withpath/large-32 37 155407604 ns/op 55805670 B/op 1757456 allocs/op
BenchmarkCalcStats/gofaster-jx_withpath/tiny-32 107339214 56.05 ns/op 0 B/op 0 allocs/op
BenchmarkCalcStats/gofaster-jx_withpath/small-32 10138044 614.3 ns/op 0 B/op 0 allocs/op
BenchmarkCalcStats/gofaster-jx_withpath/large-32 205 27768227 ns/op 20 B/op 0 allocs/op
BenchmarkGet/jscan-32 15059718 351.0 ns/op 16 B/op 2 allocs/op
BenchmarkGet/jsoniter-32 3344287 1853 ns/op 496 B/op 19 allocs/op
BenchmarkGet/tidwallgjson-32 18632041 283.8 ns/op 16 B/op 2 allocs/op
BenchmarkValid/tiny/jscan-32 135163837 44.15 ns/op 0 B/op 0 allocs/op
BenchmarkValid/tiny/jsoniter-32 134281081 43.02 ns/op 0 B/op 0 allocs/op
BenchmarkValid/tiny/gofaster-jx-32 124213034 48.40 ns/op 0 B/op 0 allocs/op
BenchmarkValid/tiny/encoding-json-32 139128472 42.56 ns/op 0 B/op 0 allocs/op
BenchmarkValid/tiny/valyala-fastjson-32 292225062 20.90 ns/op 0 B/op 0 allocs/op
BenchmarkValid/small/jscan-32 11595009 502.9 ns/op 0 B/op 0 allocs/op
BenchmarkValid/small/jsoniter-32 5421649 982.8 ns/op 56 B/op 7 allocs/op
BenchmarkValid/small/gofaster-jx-32 12536254 419.5 ns/op 0 B/op 0 allocs/op
BenchmarkValid/small/encoding-json-32 6389982 919.0 ns/op 0 B/op 0 allocs/op
BenchmarkValid/small/valyala-fastjson-32 18200816 307.3 ns/op 0 B/op 0 allocs/op
BenchmarkValid/large/jscan-32 213 28096382 ns/op 19 B/op 0 allocs/op
BenchmarkValid/large/jsoniter-32 62 87904545 ns/op 13794985 B/op 644454 allocs/op
BenchmarkValid/large/gofaster-jx-32 298 19915917 ns/op 13 B/op 0 allocs/op
BenchmarkValid/large/encoding-json-32 79 73060592 ns/op 54 B/op 0 allocs/op
BenchmarkValid/large/valyala-fastjson-32 262 22469637 ns/op 0 B/op 0 allocs/op
BenchmarkValid/unwind_stack/jscan-32 751837 8223 ns/op 0 B/op 0 allocs/op
BenchmarkValid/unwind_stack/jsoniter-32 44550 132099 ns/op 33200 B/op 1033 allocs/op
BenchmarkValid/unwind_stack/gofaster-jx-32 7948 734624 ns/op 65739 B/op 1026 allocs/op
BenchmarkValid/unwind_stack/encoding-json-32 1011835 5898 ns/op 24 B/op 1 allocs/op
BenchmarkValid/unwind_stack/valyala-fastjson-32 558 10087900 ns/op 52510084 B/op 4136 allocs/op
PASS
ok github.com/romshark/jscan 318.404s
Please also update benchmarks in readme when you have time for it :heart: