Skip to content

Update the comparing benchmark results in README #376

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

Closed
jmoh932 opened this issue Jun 12, 2019 · 0 comments
Closed

Update the comparing benchmark results in README #376

jmoh932 opened this issue Jun 12, 2019 · 0 comments

Comments

@jmoh932
Copy link

jmoh932 commented Jun 12, 2019

There are two opened issues pointing out the benchmark results are out of date. And the issue dates are really old. Issue309 and Issue339.

And I just did the benchmark myself, I grabbed the code which README linked https://github.com/json-iterator/go-benchmark/blob/master/src/github.com/json-iterator/go-benchmark/benchmark_medium_payload_test.go , and modify it to avoid building error. I just did a medium payload test. So here is the result,

$ go test -bench=. -benchmem benchdiff_test.go
goos: darwin
goarch: amd64
BenchmarkDifference/std-struct-8         	   50000	     28352 ns/op	    1960 B/op	      99 allocs/op
BenchmarkDifference/jiter-struct-8       	  300000	      5615 ns/op	     480 B/op	      45 allocs/op
BenchmarkDifference/jiter-comp-struct-8  	  300000	      5556 ns/op	     480 B/op	      45 allocs/op
BenchmarkDifference/std-map-8            	   50000	     36106 ns/op	   10341 B/op	     212 allocs/op
BenchmarkDifference/jiter-map-8          	  100000	     22802 ns/op	   10983 B/op	     266 allocs/op
BenchmarkDifference/jiter-comp-map-8     	  100000	     23020 ns/op	   10983 B/op	     266 allocs/op
PASS
ok  	command-line-arguments	12.473s
$ go version
go version go1.10.7 darwin/amd64

Should we update README, or why not?

And for more additional out of scope informations, here is another result, same test, same code and same machine, with the PR367 patched,

$ go test -bench=. -benchmem benchdiff_test.go
goos: darwin
goarch: amd64
BenchmarkDifference/std-struct-8         	   50000	     27257 ns/op	    1960 B/op	      99 allocs/op
BenchmarkDifference/jiter-struct-8       	  300000	      5246 ns/op	     414 B/op	       6 allocs/op
BenchmarkDifference/jiter-comp-struct-8  	  300000	      5387 ns/op	     414 B/op	       6 allocs/op
BenchmarkDifference/std-map-8            	   50000	     35831 ns/op	   10341 B/op	     212 allocs/op
BenchmarkDifference/jiter-map-8          	  100000	     22469 ns/op	   10671 B/op	     159 allocs/op
BenchmarkDifference/jiter-comp-map-8     	  100000	     22300 ns/op	   10672 B/op	     159 allocs/op
PASS
ok  	command-line-arguments	12.106s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant