Skip to content

Commit

Permalink
use codspeed to report benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal committed May 26, 2024
1 parent 0dc30c1 commit ac2a55e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 4 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: codspeed-benchmarks

on:
push:
branches:
- "main"
pull_request:
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:

jobs:
benchmarks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup rust toolchain, cache and cargo-codspeed binary
uses: moonrepo/setup-rust@v0
with:
channel: stable
cache-target: release
bins: cargo-codspeed

- name: Build the benchmark target(s)
run: cargo codspeed build -p biscuit-auth

- name: Run the benchmarks
uses: CodSpeedHQ/action@v2
with:
run: cargo codspeed run -p biscuit-auth
token: ${{ secrets.CODSPEED_TOKEN }}
1 change: 1 addition & 0 deletions biscuit-auth/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ colored-diff = "0.2.3"
prost-build = "0.10"
serde = { version = "1.0.130", features = ["derive"] }
serde_json = "1.0.67"
codspeed-bencher-compat = "2.6.0"

#[build-dependencies]
#prost-build = "0.10"
Expand Down
5 changes: 1 addition & 4 deletions biscuit-auth/benches/token.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#[macro_use]
extern crate bencher;

extern crate biscuit_auth as biscuit;

use bencher::Bencher;
use biscuit::{
builder::*, builder_ext::BuilderExt, datalog::SymbolTable, Biscuit, KeyPair, UnverifiedBiscuit,
};
use codspeed_bencher_compat::{benchmark_group, benchmark_main, Bencher};
use rand::rngs::OsRng;

fn create_block_1(b: &mut Bencher) {
Expand Down

0 comments on commit ac2a55e

Please sign in to comment.