Skip to content

Optional tools

This guide covers prof tools: commands that read bench/<tag>/ and produce extra artifacts such as benchstat summaries or QCacheGrind callgrind files. The same flows are available from prof ui (Tools menu).

Before you begin

prof tools benchstat

benchstat compares benchmark text results across two tags.

prof tools benchstat --base baseline --current optimized --bench-name BenchmarkGenPool

Install helper:

go install golang.org/x/perf/cmd/benchstat@latest

Output path: bench/tools/benchstat/<BenchmarkName>_results.txt

Flag Type Required Default Description
--base string Yes n/a Baseline tag under bench/.
--current string Yes n/a Current tag.
--bench-name string Yes n/a Benchmark name.

prof tools qcachegrind

Generates Callgrind input for QCacheGrind from stored binary profiles.

prof tools qcachegrind --tag optimized --profiles cpu --bench-name BenchmarkGenPool

Output path: bench/tools/qcachegrind/<BenchmarkName>_<profile>.callgrind

Flag Type Required Default Description
--tag string Yes n/a Tag to read from.
--profiles strings Yes n/a Profile IDs; the command uses the first ID you pass. Pass a single profile such as cpu when unsure.
--bench-name string Yes n/a Benchmark name.

Testing / verify

  • After benchstat, open bench/tools/benchstat/<BenchmarkName>_results.txt and confirm it references both tags.
  • After qcachegrind, confirm .callgrind files exist and open in QCacheGrind.

Next steps