# gobench: a tool for comparing Go benchmark runs across branches

DevFeed: [gobench: a tool for comparing Go benchmark runs across branches](<https://devfeed.tech/articles/gobench-a-tool-for-comparing-go-benchmark-runs-across-branches-112517.md>)

Original publisher: [Read original article](<https://alexwlchan.net/2026/gobench/>)

Published: 2026-11-01T19:38:34Z

Content type: article

Language: en

Sources: [alexwlchan](<https://devfeed.tech/sources/alexwlchan.md>)

Topics: [Tool](<https://devfeed.tech/topics/tool.md>), [Benchmark](<https://devfeed.tech/topics/benchmark.md>)

Tags: [benchmark](<https://devfeed.tech/tags/benchmark.md>), [benchmarking](<https://devfeed.tech/tags/benchmarking.md>), [compare](<https://devfeed.tech/tags/compare.md>), [go](<https://devfeed.tech/tags/go.md>), [performance](<https://devfeed.tech/tags/performance.md>), [tool](<https://devfeed.tech/tags/tool.md>)

## AI overview

gobench compares Go benchmark performance between the current feature branch and a base branch, then reports benchstat's statistical analysis. It creates a temporary Git worktree for the base, keeps benchmark output in memory, and alternates six samples between branches; alternating helps reduce noise from laptop conditions such as thermal throttling and background processes. This avoids the earlier shell script's need to specify commit IDs, leave output files, and finish with the repository in a detached HEAD state. The excerpt describes the tool as a Go program that runs git, go test, and benchstat, and gives an install command using go install.

## Source excerpt

I wrote a tool that makes it quick and easy to measure the performance impact of a proposed change.