Photo by [Alain Gehri]( on [Unsplash](

Improve your Go code with Benchmarks

We often write code without thinking about how performant the code will be in the end. Often it is also not worth to sacrifice cleaner code in terms of readability and future maintainability for the sake of a few percents of performance, be it less CPU cycles needed to compute something or a smaller memory footprint. But as always even if you don’t need to save a few cycles or bytes, it is good to know what you could do to even get started in optimize for performance....

March 31, 2023 · 7 min · 1292 words · André Sterba