Skip to content

Parser Guide

Vizb supports multiple benchmark frameworks through its parser registry. Use --parser to select the right one for your benchmark output.

Each benchmark framework produces output in a different format. Vizb’s parser registry knows how to read them all and convert the results into a common structure — so your charts, grouping, filtering, and merging work identically regardless of where the benchmarks came from.

Default parser. Reads go test -bench text or -json output.

Terminal window
go test -bench . | vizb -o output.html
# or explicitly
go test -bench . | vizb --parser go -o output.html

When JSON auto-detection applies: --parser go is required for JSON input (the go test -bench -json format).

Metrics extracted:

MetricDescription
Execution timens/op, with configurable unit
MemoryB/op, with configurable unit
Allocationsallocs/op, with configurable unit
ThroughputMB/s, B/s, GB/s, or custom
IterationsNumber of iterations run
KeyFrameworkLanguage
goGo testing (benchfmt)Go
rs:criterionCriterionRust
rs:divanDivanRust
js:vitestVitestJavaScript / TypeScript
js:tinybenchTinybenchJavaScript / TypeScript

Want to add support for a benchmark framework or language not listed here? Parser contributions are welcome. Here’s what the process looks like:

  1. Choose a key following the <lang>:<framework> convention (e.g., py:pytest, java:jmh)
  2. Implement a parse function that extracts []shared.BenchmarkData from the framework’s output
  3. Register it via parser.Register("your-key", YourParseFunc) in an init() block
  4. Add tests with real output samples and edge cases
  5. Open a PR on GitHub — the existing parsers in pkg/parser/ are good references to follow