Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Improving smaz benchmarking

Before:

Krzysztofs-MacBook-Pro-4:go-smaz kkowalczyk$ go test -bench=.
PASS
BenchmarkCompression	     500	   3451735 ns/op	  39.60 MB/s
BenchmarkDecompression	     500	   2740847 ns/op	  27.58 MB/s

After:

Krzysztofs-MacBook-Pro-4:go-smaz kkowalczyk$ go test -bench=.
PASS
BenchmarkCompression	     500	   3327594 ns/op	  41.08 MB/s
BenchmarkDecompression	    1000	   1254536 ns/op	  60.26 MB/s

Change:

Krzysztofs-MacBook-Pro-4:go-smaz kkowalczyk$ benchcmp before1.txt after1.txt
benchmark                  old ns/op     new ns/op     delta
BenchmarkCompression       3358002       3327181       -0.92%
BenchmarkDecompression     2560761       1270746       -50.38%

benchmark                  old MB/s     new MB/s     speedup
BenchmarkCompression       40.70        41.08        1.01x
BenchmarkDecompression     29.52        59.49        2.02x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.