AirspeedVelocity.jl now has a marketplace GitHub Action!
I’m excited to announce a marketplace GitHub Action for AirspeedVelocity.jl, making it very easy to measure benchmarks in pull requests to your Julia package. These show you the time AND memory changes, for all defined benchmarks, against your default branch. It even will track startup time for you.
Quickstart
You need to follow BenchmarkTools.jl formatting: define a file benchmark/benchmarks.jl
(with an optional benchmark/Project.toml
) that defines a SUITE
:
using MyPackage: my_eval
const SUITE = BenchmarkGroup()
SUITE["my_eval"] = @benchmarkable my_eval(x) setup=(x=randn(100))
If you have done this, all you need to do now is add this workflow file to .github/workflows/benchmark.yml
:
name: Benchmark this PR
on:
pull_request_target:
branches: [ master ] # or your default branch
permissions:
pull-requests: write # needed to post comments
jobs:
bench:
runs-on: ubuntu-latest
steps:
- uses: MilesCranmer/AirspeedVelocity.jl@action-v1
with:
julia-version: '1.10'
That’s it! Now every PR will include clear, collapsible benchmark reports directly in a GitHub comment:
You can click to expand these, which gives you detailed comparisons before/after the PR:
The benchmarks also automatically include time_to_load
which is computed by restarting Julia several times:
^You can see the memory benchmarks include both allocations and bytes.
You can also benchmark over multiple Julia versions! Just use the normal strategy: matrix: ...
approach. These versions will show up as separate comments in the thread:
(Edit: I’ve also now added a “job-summary” mode which dumps the benchmark to the action page, rather than to github comments)
Check out the full documentation here.
Happy benchmarking!