Daniel Posthuma

Powered by 🌱Roam Garden

Go runs the entire benchmark function multiple times with increasing levels of concurrency. This is unexpected. I of course assumed the body of the RunParallel anonymous function would be run multiple times, but I did not know that the entire func Benchmark... function would be run multiple times. This can cause issues if benchmarking libraries that manage state in a package global way.

Referenced in