Skip to content

Benchmark

Benchmark #29

Workflow file for this run

name: Benchmark
on:
schedule:
- cron: '0 5 * * 1'
workflow_dispatch: {}
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go: [ '1.24', '1.23', '1.22' ]
name: "Benchmark [ Go ${{ matrix.go }} ]"
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Cache Go modules
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Install Go stable version
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
with:
go-version: ${{ matrix.go }}
check-latest: true
- name: Install benchstat
run: |
go install golang.org/x/perf/cmd/benchstat@latest
- name: Run benchmarks
run: |
go test -bench=. -benchmem ./...