Writing Benchmarks: Performance testing in Go/Golang

A big part of programming is about making choices: What data type do I use? A map, a slice, something more fancy? Do I implement this using recursion or a loop? Should I pass a value or a pointer? How to determine the best choice? One way is to measure performance using benchmarks . Go has built-in support for benchmarking in the testing package. In this article you&rsquo;ll see how benchmarks are…