Add codspeed

This commit is contained in:
Micha Reiser 2024-07-26 11:55:14 +02:00
parent fc0a82bd10
commit d18d8008e9
No known key found for this signature in database
3 changed files with 42 additions and 2 deletions

View file

@ -89,3 +89,43 @@ jobs:
- name: Run examples with Miri
run: |
cargo miri run --example calc
benchmarks:
name: Benchmarks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@master
id: rust-toolchain
with:
toolchain: stable
- name: "Setup codspeed"
uses: taiki-e/install-action@v2
with:
tool: cargo-codspeed
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-${{ hashFiles('**/Cargo.toml') }}
restore-keys: |
${{ runner.os }}-cargo-${{ steps.rust-toolchain.outputs.cachekey }}-
${{ runner.os }}-cargo-
- name: "Build benchmarks"
run: cargo codspeed build
- name: "Run benchmarks"
uses: CodSpeedHQ/action@v2
with:
run: cargo codspeed run
token: ${{ secrets.CODSPEED_TOKEN }}

View file

@ -24,7 +24,7 @@ smallvec = "1.0.0"
[dev-dependencies]
annotate-snippets = "0.11.4"
criterion = "0.5.1"
codspeed-criterion-compat = { version = "2.6.0", default-features = false }
derive-new = "0.5.9"
expect-test = "1.4.0"
eyre = "0.6.8"

View file

@ -1,4 +1,4 @@
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
use codspeed_criterion_compat::{criterion_group, criterion_main, BatchSize, Criterion};
use salsa::Setter;
#[salsa::input]