Skip to content

Commit f0fbda1

Browse files
authored
Update codspeed to v4 (#16139)
Simplifies the codspeed setup.
1 parent 40397dd commit f0fbda1

File tree

5 files changed

+98
-80
lines changed

5 files changed

+98
-80
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2884,12 +2884,13 @@ jobs:
28842884
cargo run --bin uv -- pip compile scripts/requirements/airflow.in --universal --exclude-newer 2024-08-08 --cache-dir .cache
28852885
28862886
- name: "Build benchmarks"
2887-
run: cargo codspeed build --profile profiling --features codspeed -p uv-bench
2887+
run: cargo codspeed build --profile profiling -p uv-bench
28882888

28892889
- name: "Run benchmarks"
2890-
uses: CodSpeedHQ/action@0b6e7a3d96c9d2a6057e7bcea6b45aaf2f7ce60b # v3.8.0
2890+
uses: CodSpeedHQ/action@6b43a0cd438f6ca5ad26f9ed03ed159ed2df7da9 # v4.1.1
28912891
with:
28922892
run: cargo codspeed run
2893+
mode: walltime
28932894
token: ${{ secrets.CODSPEED_TOKEN }}
28942895

28952896
benchmarks-instrumented:
@@ -2923,10 +2924,11 @@ jobs:
29232924
cargo run --bin uv -- pip compile scripts/requirements/airflow.in --universal --exclude-newer 2024-08-08 --cache-dir .cache
29242925
29252926
- name: "Build benchmarks"
2926-
run: cargo codspeed build --profile profiling --features codspeed -p uv-bench
2927+
run: cargo codspeed build --profile profiling -p uv-bench
29272928

29282929
- name: "Run benchmarks"
2929-
uses: CodSpeedHQ/action@0b6e7a3d96c9d2a6057e7bcea6b45aaf2f7ce60b # v3.8.0
2930+
uses: CodSpeedHQ/action@6b43a0cd438f6ca5ad26f9ed03ed159ed2df7da9 # v4.1.1
29302931
with:
29312932
run: cargo codspeed run
2933+
mode: instrumentation
29322934
token: ${{ secrets.CODSPEED_TOKEN }}

Cargo.lock

Lines changed: 90 additions & 61 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/uv-bench/Cargo.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,12 @@ uv-types = { workspace = true }
4343
uv-workspace = { workspace = true }
4444

4545
anyhow = { workspace = true }
46-
codspeed-criterion-compat = { version = "3.0.2", default-features = false, optional = true }
47-
criterion = { version = "0.7.0", default-features = false, features = [
48-
"async_tokio",
49-
] }
46+
criterion = { version = "4.0.3", default-features = false, package = "codspeed-criterion-compat", features = ["async_tokio"] }
5047
jiff = { workspace = true }
5148
tokio = { workspace = true }
5249

5350
[package.metadata.cargo-shear]
5451
ignored = ["uv-extract"]
5552

5653
[features]
57-
codspeed = ["codspeed-criterion-compat"]
5854
static = ["uv-extract/static"]

crates/uv-bench/benches/uv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::hint::black_box;
22
use std::str::FromStr;
33

4-
use uv_bench::criterion::{Criterion, criterion_group, criterion_main, measurement::WallTime};
4+
use criterion::{Criterion, criterion_group, criterion_main, measurement::WallTime};
55
use uv_cache::Cache;
66
use uv_client::{BaseClientBuilder, RegistryClientBuilder};
77
use uv_distribution_types::Requirement;

crates/uv-bench/src/lib.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1 @@
1-
pub mod criterion {
2-
//! This module re-exports the criterion API but picks the right backend depending on whether
3-
//! the benchmarks are built to run locally or with codspeed
41

5-
#[cfg(not(feature = "codspeed"))]
6-
pub use criterion::*;
7-
8-
#[cfg(feature = "codspeed")]
9-
pub use codspeed_criterion_compat::*;
10-
}

0 commit comments

Comments
 (0)