Benchmarking measures and compares program performance across algorithms, implementations, or versions. In Go, the built-in bench command supports repeatable performance checks alongside ordinary tests. section 1.3.1 section 1.4
Use benchmarks to:
- Compare different algorithms or implementations. section 1.3.1
- Compare versions and check each commit for performance deterioration. section 1.3.1
- Measure concurrency choices, such as buffered-channel sizes, on hardware resembling the deployment machine. section 7.5.2
Benchmark the workload, not just the code
A remote-file workload can overload or trigger limits on the server, while single-machine video encoding can already saturate the CPU. Benchmark concurrency choices under a similar machine architecture before increasing parallelism; otherwise, extra goroutines may make performance worse. section 7.5.2






















