Which way is faster in Go?
Every benchmark on this site takes one task, implements it several ways, and measures them with go test -bench on the same machine. The results are rendered as interactive charts, so you can see not just which approach wins, but how each one scales with input size and CPU count.
- 24
- benchmarks
- 79
- implementations
- 1–32
- CPU cores
All benchmarks
24 comparisons of common Go patterns, from string handling to concurrency.
How the numbers are made
Each comparison is a plain Go benchmark. The source for every implementation lives in the open repository and is shown on its page, so you can check exactly what was measured or run it yourself.
A small CLI runs every suite with go test -bench . -benchmem across several input sizes and CPU counts (1 to 32 cores) on the same machine, currently an AMD Ryzen 9 9950X3D 16-Core Processor. The raw output is parsed into JSON and this site is rebuilt from it. No number on these pages is typed in by hand.
Keep in mind these are microbenchmarks: they tell you the relative cost of one pattern against another, not how your whole program will behave. When results are within a few percent of each other, treat them as a tie.