Closed
Description
What did you do?
- I wanted to make sure I was creating accurate benchmarks.
- I found and read Dave Cheney's 2013 blog post on how to write benchmarks in Go. In the "A note on compiler optimisations" section he mentions that it is best practice to assign results to local and package level variables to avoid optimizations.
- I went to https://golang.org/pkg/testing/#hdr-Benchmarks
What did you expect to see?
I expected to see documentation on how to correctly write benchmarks that avoid compiler optimizations and examples that reflect best practices.
If the techniques described in Dave's blog post are no longer necessary, I expected to see explicit documentation to that effect.
What did you see instead?
Neither of those things.