Skip to content

FerrFlow Benchmarks

Reusable GitHub Action for FerrFlow performance benchmarks.

Runs the micro and full suites, compares against competing release tools,
and fails the PR when a regression crosses the threshold.

CILicenseOpenSSF Scorecard

FerrFlow | Fixtures

Usage

- uses: FerrLabs/Benchmarks@v2with:
type: micro # micro, full, or allferrflow-token: ${{ secrets.FERRFLOW_TOKEN }}

Inputs

InputDescriptionDefault
typeBenchmark type: micro, full, or allall
skip-competitorsSkip competitor benchmarks in full modefalse
alert-thresholdRegression alert threshold for micro benchmarks (e.g. 120%)120%
full-regression-thresholdRelative threshold for full benchmark regressions (e.g. 125%)125%
binary-size-thresholdBinary size growth threshold (e.g. 120%)120%
comment-on-prPost benchmark results as PR commenttrue
warmupNumber of warmup runs before timing (hyperfine --warmup)2
runsNumber of timed runs (hyperfine --runs)10
definitionsPath to fixture definitions for benchmark generationrequired
verboseShow full error output when a benchmark command fails validationfalse
ferrflow-tokenGitHub token for PR comments and artifact accessrequired
group-filterCriterion bench group filter (substring) for micro matrix sharding''
binary-dirDirectory holding a prebuilt ferrflow executable. When set, the full benchmark skips its own cargo build --release and puts this directory on PATH''
fixtures-dirDirectory of already-generated fixtures. When set, the full benchmark skips its own generation''
shardRun as a matrix shard: benchmark and write latest.json, skip baseline/compare/comment/uploadsfalse
merge-partialsDirectory of partial latest.json files. When set, skip building and benchmarking; merge the partials, then compare and upload over the merged result''

Sharding the full benchmark

The full benchmark runs every fixture sequentially, so wall-clock is the sum of them all. To spread it over runners, generate the fixtures once, run one shard per fixture, then aggregate:

  1. Shards: one job per fixture, each with shard: true, a fixtures-dir holding only its own fixture, and binary-dir pointing at a prebuilt binary. Each uploads its benchmarks/results/latest.json as a partial.
  2. Aggregate: one job that downloads every partial into a directory and passes it as merge-partials. It merges them and runs the regression check, PR comment and uploads once, over the whole result.

Shard per fixture, never per tool: the comparison ferrflow-vs-competitors only means something when both ran on the same machine. Per-fixture shards keep each comparison inside one runner; only absolute numbers between fixtures come from different hardware.

Outputs

OutputDescription
regression-detectedtrue if a performance regression was detected
benchmark-summaryFormatted benchmark summary (markdown) for release notes

Benchmark types

Micro (micro)

Runs criterion benchmarks (cargo bench) and compares against a stored baseline using benchmark-action/github-action-benchmark.

  • On PRs: downloads baseline artifact, compares, posts PR comment
  • On main push: saves new baseline artifact

Full (full)

Runs end-to-end benchmarks with hyperfine across multiple fixture sizes (single repo, mono-small, mono-medium, mono-large). Optionally compares against competitor tools (semantic-release, changesets, release-please).

  • Generates fixtures via the FerrLabs/Fixtures action from the JSON definitions directory you pass
  • Measures execution time, memory usage, and binary size
  • Compares against stored baseline and detects regressions (configurable threshold, default 25%)

The head-to-head against competitors pins ferrflow --jobs 1. Competing tools are single-threaded, so letting FerrFlow use every core would measure the runner rather than the tool. Parallel speedup is reported separately as ferrflow_parallel alongside runner_cores, and never as the headline number.

Requirements

The calling workflow must provide:

  • Rust nightly toolchain (dtolnay/rust-toolchain@nightly)
  • Rust cache (Swatinem/rust-cache@v2)
  • Node.js (for full benchmarks with competitors): actions/setup-node@v6
  • A project with cargo bench --bench ferrflow_benchmarks (for micro)
  • A directory of JSON fixture definitions, passed via the definitions input. The action generates the fixtures with FerrLabs/Fixtures (for full)
  • A project that builds a release binary with cargo build --release. The action puts target/release on PATH and benchmarks it (for full)

About

Reusable GitHub Action for FerrFlow performance benchmarks, with regression gating against a stored baseline.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages