Skip to content

Instantly share code, notes, and snippets.

@mrsndmn
Created February 6, 2020 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrsndmn/5d1ee5125b4e0a846c2cbd3ab292b248 to your computer and use it in GitHub Desktop.
Save mrsndmn/5d1ee5125b4e0a846c2cbd3ab292b248 to your computer and use it in GitHub Desktop.
strange go bench
go test -v -bench=BenchmarkIteratorNext -benchmem
...
BenchmarkIteratorNext-8 2000732 576 ns/op 8 B/op 0 allocs/op
go test -v -bench=BenchmarkIteratorNext -benchmem -cpuprofile=cpu.out -memprofile=mem.out -memprofilerate=1
...
BenchmarkIteratorNext-8 513028 2746 ns/op 8 B/op 1 allocs/op
go test -v -bench=BenchmarkIteratorNext -benchmem -memprofile=mem.out -memprofilerate=1
...
BenchmarkIteratorNext-8 544665 2856 ns/op 7 B/op 0 allocs/op
go test -v -bench=BenchmarkIteratorNext -benchmem -memprofile=mem.out
...
BenchmarkIteratorNext-8 1892781 595 ns/op 8 B/op 0 allocs/op
go test -v -bench=BenchmarkIteratorNext -benchmem -cpuprofile=cpu.out
BenchmarkIteratorNext-8 1871590 611 ns/op 8 B/op 0 allocs/op
go test -v -bench=BenchmarkIteratorNext -benchmem -cpuprofile=cpu.out -memprofile=mem.out
BenchmarkIteratorNext-8 1892508 607 ns/op 8 B/op 0 allocs/op
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment