Setup CodSpeed for continuous performance monitoring

- Replace criterion 0.3 with codspeed-criterion-compat 4.3.0 using
  dependency renaming (no benchmark code changes needed)
- Add CodSpeed GitHub Actions workflow with OIDC authentication
- Add CodSpeed badge to README
This commit is contained in:
codspeed-hq[bot]
2026-02-18 20:43:07 +00:00
committed by GitHub
parent f6894a6e82
commit e3ec4ccf69
4 changed files with 311 additions and 83 deletions
+37
View File
@@ -0,0 +1,37 @@
name: CodSpeed
on:
push:
branches:
- "main"
pull_request:
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:
permissions:
contents: read
id-token: write
jobs:
codspeed:
name: Run benchmarks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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 num-prime-bench
- name: Run the benchmarks
uses: CodSpeedHQ/action@v4
with:
mode: simulation
run: cargo codspeed run -p num-prime-bench
Generated
+272 -82
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -1,6 +1,7 @@
# num-prime
[![Crates.io](https://img.shields.io/crates/v/num-prime.svg)](https://crates.io/crates/num-prime)
[![CodSpeed](https://img.shields.io/endpoint?url=https://codspeed.io/badge.json)](https://codspeed.io/uutils/num-prime?utm_source=badge)
[![Discord](https://img.shields.io/badge/discord-join-7289DA.svg?logo=discord&longCache=true&style=flat)](https://discord.gg/wQVJbvJ)
[![License](http://img.shields.io/badge/license-Apache%202-blue.svg)](https://github.com/uutils/num-prime/blob/main/LICENSE)
[![dependency status](https://deps.rs/repo/github/uutils/num-prime/status.svg)](https://deps.rs/repo/github/uutils/num-prime)
+1 -1
View File
@@ -11,7 +11,7 @@ harness = false
[dependencies]
num-bigint = "0.4"
num-prime = { path = ".." }
criterion = "0.3"
criterion = { version = "4.3.0", package = "codspeed-criterion-compat" }
rand = "0.8"
num-primes = { version = "0.3.0", optional = true }