Skip to content
πŸ“‰ CLI for inspecting Go benchmark output and GitHub Action for continuous benchmarking
Go JavaScript HTML Shell CSS Dockerfile Other
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github
.static
bench all: rename to go.bobheadxi.dev/gobenchdata May 6, 2019
demo
gotools
internal
x/gobenchdata-web
.gitignore
CONTRIBUTING.md
Dockerfile
LICENCE
Makefile
README.md
azure-pipelines.yml
doc.go
entrypoint.sh
go.mod
go.sum mod: update sum May 6, 2019
main.go
merge.go all: rename to go.bobheadxi.dev/gobenchdata May 6, 2019
output.go
output_test.go

README.md

πŸ“‰ gobenchdata

Build Status View Action GoDoc Demo

a tool for inspecting go test -bench data, and a GitHub Action for continuous benchmarking.

example

About

gobenchdata was inspired by the deno.land continuous benchmarks, which aims to display performance improvements/regressions on a continuous basis.

It is available as a GitHub action or a command-line application.

GitHub Action

gobenchdata can be used as GitHub Action for uploading Go benchmark data as JSON to gh-pages and visualizing it with a generated web app (using gobenchdata-web) or your own web application.

Setup

For example, in main.workflow:

workflow "Benchmark" {
  on = "push"
  resolves = ["gobenchdata to gh-pages"]
}

action "filter" {
  uses = "actions/bin/filter@master"
  args = "branch master"
}

action "gobenchdata to gh-pages" {
  uses = "bobheadxi/gobenchdata@master"
  needs = ["filter"]
  secrets = ["GITHUB_TOKEN"]
  env = {
    PRUNE_COUNT = "20"
  }
}

Learn more about GitHub Actions in the official documentation.

Configuration

Variable Default Purpose
GITHUB_TOKEN set by GitHub token to provide access to repository
GITHUB_ACTOR set by GitHub the user to make commits as
GIT_COMMIT_MESSAGE "add new benchmark run" the commit message for the benchmark update
GO_BENCHMARKS . benchmarks to run (argument for -bench)
GO_BENCHMARK_FLAGS additional flags for go test
GO_BENCHMARK_PKGS ./... packages to test (argument for go test)
FINAL_OUTPUT benchmarks.json destination path of benchmark data
PRUNE_COUNT 0 number of past runs to keep (0 keeps everything)

Visualisation

The gobenchdata GitHub action eventually generates a JSON file with past benchmarks. You can visualize these continuous benchmarks by creating a web app that reads from the JSON benchmarks file, or by using gobenchdata-web:

go get -u go.bobheadxi.dev/gobenchdata/x/gobenchdata-web
git checkout gh-pages
gobenchdata-web --title "my benchmarks" # generates a web app in your working directory

You test the web app locally using a tool like serve:

serve .

This feature is a work in progress. An example site published by this repository is available at gobenchdata.bobheaxi.dev.

gobenchdata CLI

gobenchdata, which the GitHub Action leverages to manage benchmark data, is also available as a CLI:

go get -u go.bobheadxi.dev/gobenchdata
gobenchdata help

Usage documentation can be found in the godocs.

Development and Contributions

Please report bugs and requests in the repository issues!

See CONTRIBUTING.md for more detailed development documentation.

You can’t perform that action at this time.