Skip to content

ZackarySantana/gb

Repository files navigation

Go Benchmark Notes Manager

Demo

Do you want to easily track Go benchmark performance over time? Do you want a CLI tool that bundles a nice looking UI that displays graphs comparing benchmark results between commits? You want gb.

gb is a CLI tool that runs Go benchmarks, stores the notes in git notes, and provides commands to view and compare benchmark results over time.

At a high level, gb provides the following commands:

  • backfill: Run benchmarks for commits that do not have benchmark notes yet.
  • show: View benchmark notes for a specific commit.
  • compare: Compare benchmark results between two commits.
  • sync: Push and fetch benchmark notes to/from remote.
  • export: Export benchmark notes to a directory.
  • display: Display a static UI for comparing benchmark results (E.g. the Demo site).
  • help: View help for gb commands.

Installation

go install github.com/zackarysantana/gb

GitHub Pages

One of the most elegant thing about gb is that the generated site is completely static. The Demo site is hosted on GitHub Pages. To do something similar for your own repository, look inside .github/workflows/benchmarks.yml.

Usage

Backfill

Run benchmarks:

# Run benchmarks for last 6 commits (includes HEAD).
gb backfill HEAD~5

Backfill Example

View benchmark notes for a specific commit:

Show

gb show HEAD~3

Show Example

View all benchmark notes for a specific commit (e.g. ones pushed from remote):

gb show HEAD~4 --all

(arm64 vs amd64 benchmarks shown below) Show All Example

Compare

Compare benchmarks between two commits:

gb compare HEAD~3 HEAD~1
# The default is HEAD~1 vs HEAD
gb compare

Compare Example

Sync

Sync notes with remote:

gb sync

Sync Example

Export

Export notes in to a directory

gb export HEAD~3
# For more options
gb export --help

Export Example

Display

Display a UI for comparing benchmarks:

gb display

Display Example

(This looks for a ./benchmarks directory with exported benchmark notes)

Manual

NAME:

  • gb - Go benchmark notes manager

USAGE:

  • gb [global options] [command [command options]]

COMMANDS:

  • backfill Backfill benchmark notes with missing commits since a ref
  • compare Compare stored notes for two refs
  • display Display benchmark notes via a UI
  • export Export benchmark notes to a file
  • show Show stored note for a commit/ref
  • sync Sync benchmark notes with remote (push/fetch)
  • help, h Shows a list of commands or help for one command

GLOBAL OPTIONS:

  • -v, --verbose (default: false)
  • --count int benchmark count (default: 10)
  • --benchtime string benchtime duration (e.g. 2s)
  • --bench string benchmark regex (default: ".")
  • --pkgs string comma-separated package list (default: "./...")
  • --notes-ref string override notes ref (will always be prefixed with refs/notes/gb/) (default: "601e17bd28b350c5/linux-arm64-go1.25.1")
  • --help, -h show help

About

GO Benchmark

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors