Common pitfalls in Go benchmarking
(eli.thegreenplace.net)
from tedu to golang@programming.dev on 25 Jul 2023 17:21
https://azorius.net/p/FzFg36fqdr1jcGVLS3
from tedu to golang@programming.dev on 25 Jul 2023 17:21
https://azorius.net/p/FzFg36fqdr1jcGVLS3
Go programmers have the good fortune of excellent testing and benchmarking tooling built into the standard library - in the testing package. However, benchmarking is hard. This isn't Go specific; it's just one of those things experienced developers learn over time.
This post lists some common benchmarking pitfalls Go programmers run into. It assumes basic familiarity with writing Go benchmarks; consult the testing package documentation if needed. While these pitfalls are presented in Go, they exist in any programming language or environment, so the lessons learned here are widely applicable.
threaded - newest