Skip to content

⚡️📊 Compare the performance of Rust project branches

License

Notifications You must be signed in to change notification settings

boa-dev/criterion-compare-action

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date
Jun 7, 2022
May 31, 2022
Aug 1, 2019
Jan 29, 2022
Feb 22, 2022
Aug 1, 2019
Mar 13, 2022
Mar 13, 2022
Aug 1, 2019
Apr 6, 2022
May 31, 2022
May 31, 2022

Repository files navigation

criterion-compare

Compare the performance of a PR against the base branch.


⚠️ Performance benchmarks provided by this action may fluctuate as load on GitHub Actions does. Run benchmarks locally before making any decisions based on the results.

A GitHub action that will compare the benchmark output between a PR and the base branch, using the project's criterion.rs benchmarks.

Example

Example benchmark comparison comment

Usage

Create a .github/workflows/pull_request.yml file in your repo:

on: [pull_request]
name: benchmark pull requests
jobs:
  runBenchmark:
    name: run benchmark
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - uses: boa-dev/criterion-compare-action@v3.0.0
        with:
          cwd: "subDirectory (optional)"
          # Optional. Compare only this benchmark target
          benchName: "example-bench-target"
          # Optional. Disables the default features of a crate
          defaultFeatures: false
          # Optional. Features activated in the benchmark
          features: "async,tokio-support"
          # Needed. The name of the branch to compare with. This default uses the branch which is being pulled against
          branchName: ${{ github.base_ref }}
          # Optional. Default is `${{ github.token }}`.
          token: ${{ secrets.GITHUB_TOKEN }}

Troubleshooting

Unrecognized option: 'save-baseline'

If you encounter this error, you can check this Criterion FAQ, to find a workaround.