Daniel Posthuma

Powered by 🌱Roam Garden

Go

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

September 30th, 2021

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.

Daniel Posthuma

Hello 👋, I’m Daniel - a software engineer building high performance bidding systems for Martin that support billions of requests per day with exceptionally low latency. My interests primarily revolve around distributed systems, DeFi, and algorithmic trading. Most of the code I write is in Go, C, C++, or Clojure and in my spare time you’ll find me hacking on Distributed Operating Systems, text editors, or enjoying the outdoors with my family.