demo

GitHub Repository

CI Status GitHub Action demo status

gobenchdata is a tool for parsing and inspecting go test -bench data, and a GitHub Action for continuous benchmarking. It was inspired by the deno.land continuous benchmarks, which aims to display performance improvements and regressions on a continuous basis.

# Command Line App

  • converts Go benchmark data to JSON and handles as saving, merging, and managing datasets of benchmark runs
  • generates a web app that instantly provides a visualisation of your benchmark performance over time
  • comparing benchmark runs on different branches and enforcing performance requirements with a highly configurable set of options:
checks:
- name: My Check
  description: |-
    Define a check here - in this example, we caculate % difference for NsPerOp in the diff function.
    diff is a function where you receive two parameters, current and base, and in general this function
    should return a negative value for an improvement and a positive value for a regression.
  package: .
  benchmarks: [ BenchmarkA, BenchmarkB ]
  diff: (current.NsPerOp - base.NsPerOp) / base.NsPerOp * 100
  thresholds:
    max: 10

# GitHub Action

The CLI can also be leveraged in GitHub Actions. Setup for the Action is very simple:

name: gobenchdata publish
on: push
jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
    - name: checkout
      uses: actions/checkout@v2
    - name: gobenchdata publish
      uses: bobheadxi/gobenchdata@v1
      with:
        PRUNE_COUNT: 30
        GO_TEST_FLAGS: -cpu 1,2
        PUBLISH: true
        PUBLISH_BRANCH: gh-pages
      env:
        GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

The Action can also be used to perform regression checks on benchmark results.

Drop by the repository to learn more!