Update codspeed to v4 (#16139)

Simplifies the codspeed setup.
This commit is contained in:
konsti 2025-10-09 15:57:05 +02:00 committed by GitHub
parent 40397ddb4b
commit f0fbda1001
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 100 additions and 82 deletions

View File

@ -2884,12 +2884,13 @@ jobs:
cargo run --bin uv -- pip compile scripts/requirements/airflow.in --universal --exclude-newer 2024-08-08 --cache-dir .cache cargo run --bin uv -- pip compile scripts/requirements/airflow.in --universal --exclude-newer 2024-08-08 --cache-dir .cache
- name: "Build benchmarks" - name: "Build benchmarks"
run: cargo codspeed build --profile profiling --features codspeed -p uv-bench run: cargo codspeed build --profile profiling -p uv-bench
- name: "Run benchmarks" - name: "Run benchmarks"
uses: CodSpeedHQ/action@0b6e7a3d96c9d2a6057e7bcea6b45aaf2f7ce60b # v3.8.0 uses: CodSpeedHQ/action@6b43a0cd438f6ca5ad26f9ed03ed159ed2df7da9 # v4.1.1
with: with:
run: cargo codspeed run run: cargo codspeed run
mode: walltime
token: ${{ secrets.CODSPEED_TOKEN }} token: ${{ secrets.CODSPEED_TOKEN }}
benchmarks-instrumented: benchmarks-instrumented:
@ -2923,10 +2924,11 @@ jobs:
cargo run --bin uv -- pip compile scripts/requirements/airflow.in --universal --exclude-newer 2024-08-08 --cache-dir .cache cargo run --bin uv -- pip compile scripts/requirements/airflow.in --universal --exclude-newer 2024-08-08 --cache-dir .cache
- name: "Build benchmarks" - name: "Build benchmarks"
run: cargo codspeed build --profile profiling --features codspeed -p uv-bench run: cargo codspeed build --profile profiling -p uv-bench
- name: "Run benchmarks" - name: "Run benchmarks"
uses: CodSpeedHQ/action@0b6e7a3d96c9d2a6057e7bcea6b45aaf2f7ce60b # v3.8.0 uses: CodSpeedHQ/action@6b43a0cd438f6ca5ad26f9ed03ed159ed2df7da9 # v4.1.1
with: with:
run: cargo codspeed run run: cargo codspeed run
mode: instrumentation
token: ${{ secrets.CODSPEED_TOKEN }} token: ${{ secrets.CODSPEED_TOKEN }}

155
Cargo.lock generated
View File

@ -422,12 +422,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
[[package]] [[package]]
name = "bincode" name = "bindgen"
version = "1.3.3" version = "0.72.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895"
dependencies = [ dependencies = [
"serde", "bitflags 2.9.4",
"cexpr",
"clang-sys",
"itertools 0.13.0",
"log",
"prettyplease",
"proc-macro2",
"quote",
"regex",
"rustc-hash",
"shlex",
"syn",
] ]
[[package]] [[package]]
@ -622,6 +633,15 @@ dependencies = [
"shlex", "shlex",
] ]
[[package]]
name = "cexpr"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
dependencies = [
"nom",
]
[[package]] [[package]]
name = "cfg-if" name = "cfg-if"
version = "1.0.1" version = "1.0.1"
@ -681,6 +701,17 @@ dependencies = [
"inout", "inout",
] ]
[[package]]
name = "clang-sys"
version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4"
dependencies = [
"glob",
"libc",
"libloading",
]
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.5.48" version = "4.5.48"
@ -754,16 +785,17 @@ checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675"
[[package]] [[package]]
name = "codspeed" name = "codspeed"
version = "3.0.5" version = "4.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35584c5fcba8059780748866387fb97c5a203bcfc563fc3d0790af406727a117" checksum = "e7b36534e9bb9623ea6070ec939a6bc52b5faea0c02f05e412545ea38d01fe93"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bincode", "bindgen",
"cc",
"colored", "colored",
"glob", "glob",
"libc", "libc",
"nix 0.29.0", "nix",
"serde", "serde",
"serde_json", "serde_json",
"statrs", "statrs",
@ -772,27 +804,32 @@ dependencies = [
[[package]] [[package]]
name = "codspeed-criterion-compat" name = "codspeed-criterion-compat"
version = "3.0.5" version = "4.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "78f6c1c6bed5fd84d319e8b0889da051daa361c79b7709c9394dfe1a882bba67" checksum = "918f6027e7cd5f3603bad6db773f6dfcfb387c557f29a7e7a335346e0ac78e7b"
dependencies = [ dependencies = [
"clap",
"codspeed", "codspeed",
"codspeed-criterion-compat-walltime", "codspeed-criterion-compat-walltime",
"colored", "colored",
"futures",
"regex",
"tokio",
] ]
[[package]] [[package]]
name = "codspeed-criterion-compat-walltime" name = "codspeed-criterion-compat-walltime"
version = "3.0.5" version = "4.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c989289ce6b1cbde72ed560496cb8fbf5aa14d5ef5666f168e7f87751038352e" checksum = "fdc1f0b784c181c0a37ac523aa600452bc8a43f42064321c5143eb3832828f2e"
dependencies = [ dependencies = [
"anes", "anes",
"cast", "cast",
"ciborium", "ciborium",
"clap", "clap",
"codspeed", "codspeed",
"criterion-plot 0.5.0", "criterion-plot",
"futures",
"is-terminal", "is-terminal",
"itertools 0.10.5", "itertools 0.10.5",
"num-traits", "num-traits",
@ -803,6 +840,7 @@ dependencies = [
"serde_derive", "serde_derive",
"serde_json", "serde_json",
"tinytemplate", "tinytemplate",
"tokio",
"walkdir", "walkdir",
] ]
@ -953,28 +991,6 @@ dependencies = [
"cfg-if", "cfg-if",
] ]
[[package]]
name = "criterion"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1c047a62b0cc3e145fa84415a3191f628e980b194c2755aa12300a4e6cbd928"
dependencies = [
"anes",
"cast",
"ciborium",
"clap",
"criterion-plot 0.6.0",
"itertools 0.13.0",
"num-traits",
"oorandom",
"regex",
"serde",
"serde_json",
"tinytemplate",
"tokio",
"walkdir",
]
[[package]] [[package]]
name = "criterion-plot" name = "criterion-plot"
version = "0.5.0" version = "0.5.0"
@ -985,16 +1001,6 @@ dependencies = [
"itertools 0.10.5", "itertools 0.10.5",
] ]
[[package]]
name = "criterion-plot"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b1bcc0dc7dfae599d84ad0b1a55f80cde8af3725da8313b528da95ef783e338"
dependencies = [
"cast",
"itertools 0.13.0",
]
[[package]] [[package]]
name = "crossbeam-deque" name = "crossbeam-deque"
version = "0.8.6" version = "0.8.6"
@ -1064,7 +1070,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "881c5d0a13b2f1498e2306e82cbada78390e152d4b1378fb28a84f4dcd0dc4f3" checksum = "881c5d0a13b2f1498e2306e82cbada78390e152d4b1378fb28a84f4dcd0dc4f3"
dependencies = [ dependencies = [
"dispatch", "dispatch",
"nix 0.30.1", "nix",
"windows-sys 0.61.0", "windows-sys 0.61.0",
] ]
@ -1806,7 +1812,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68df315d2857b2d8d2898be54a85e1d001bbbe0dbb5f8ef847b48dd3a23c4527" checksum = "68df315d2857b2d8d2898be54a85e1d001bbbe0dbb5f8ef847b48dd3a23c4527"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"nix 0.30.1", "nix",
"widestring", "widestring",
"windows 0.61.3", "windows 0.61.3",
] ]
@ -2343,6 +2349,16 @@ version = "0.2.175"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543"
[[package]]
name = "libloading"
version = "0.8.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55"
dependencies = [
"cfg-if",
"windows-link 0.2.0",
]
[[package]] [[package]]
name = "libmimalloc-sys" name = "libmimalloc-sys"
version = "0.1.43" version = "0.1.43"
@ -2559,6 +2575,12 @@ dependencies = [
"unicase", "unicase",
] ]
[[package]]
name = "minimal-lexical"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
[[package]] [[package]]
name = "miniz_oxide" name = "miniz_oxide"
version = "0.8.9" version = "0.8.9"
@ -2618,18 +2640,6 @@ dependencies = [
"rand 0.8.5", "rand 0.8.5",
] ]
[[package]]
name = "nix"
version = "0.29.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
dependencies = [
"bitflags 2.9.4",
"cfg-if",
"cfg_aliases",
"libc",
]
[[package]] [[package]]
name = "nix" name = "nix"
version = "0.30.1" version = "0.30.1"
@ -2643,6 +2653,16 @@ dependencies = [
"memoffset", "memoffset",
] ]
[[package]]
name = "nom"
version = "7.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
dependencies = [
"memchr",
"minimal-lexical",
]
[[package]] [[package]]
name = "normalize-line-endings" name = "normalize-line-endings"
version = "0.3.0" version = "0.3.0"
@ -3080,6 +3100,16 @@ dependencies = [
"yansi", "yansi",
] ]
[[package]]
name = "prettyplease"
version = "0.2.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
dependencies = [
"proc-macro2",
"syn",
]
[[package]] [[package]]
name = "priority-queue" name = "priority-queue"
version = "2.5.0" version = "2.5.0"
@ -5256,7 +5286,7 @@ dependencies = [
"insta", "insta",
"itertools 0.14.0", "itertools 0.14.0",
"miette", "miette",
"nix 0.30.1", "nix",
"open", "open",
"owo-colors", "owo-colors",
"petgraph", "petgraph",
@ -5393,7 +5423,6 @@ version = "0.0.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"codspeed-criterion-compat", "codspeed-criterion-compat",
"criterion",
"jiff", "jiff",
"tokio", "tokio",
"uv-cache", "uv-cache",
@ -6605,7 +6634,7 @@ dependencies = [
"anyhow", "anyhow",
"fs-err", "fs-err",
"home", "home",
"nix 0.30.1", "nix",
"same-file", "same-file",
"tempfile", "tempfile",
"tracing", "tracing",
@ -7518,7 +7547,7 @@ dependencies = [
"futures-core", "futures-core",
"futures-lite", "futures-lite",
"hex", "hex",
"nix 0.30.1", "nix",
"ordered-stream", "ordered-stream",
"serde", "serde",
"serde_repr", "serde_repr",

View File

@ -43,10 +43,7 @@ uv-types = { workspace = true }
uv-workspace = { workspace = true } uv-workspace = { workspace = true }
anyhow = { workspace = true } anyhow = { workspace = true }
codspeed-criterion-compat = { version = "3.0.2", default-features = false, optional = true } criterion = { version = "4.0.3", default-features = false, package = "codspeed-criterion-compat", features = ["async_tokio"] }
criterion = { version = "0.7.0", default-features = false, features = [
"async_tokio",
] }
jiff = { workspace = true } jiff = { workspace = true }
tokio = { workspace = true } tokio = { workspace = true }
@ -54,5 +51,4 @@ tokio = { workspace = true }
ignored = ["uv-extract"] ignored = ["uv-extract"]
[features] [features]
codspeed = ["codspeed-criterion-compat"]
static = ["uv-extract/static"] static = ["uv-extract/static"]

View File

@ -1,7 +1,7 @@
use std::hint::black_box; use std::hint::black_box;
use std::str::FromStr; use std::str::FromStr;
use uv_bench::criterion::{Criterion, criterion_group, criterion_main, measurement::WallTime}; use criterion::{Criterion, criterion_group, criterion_main, measurement::WallTime};
use uv_cache::Cache; use uv_cache::Cache;
use uv_client::{BaseClientBuilder, RegistryClientBuilder}; use uv_client::{BaseClientBuilder, RegistryClientBuilder};
use uv_distribution_types::Requirement; use uv_distribution_types::Requirement;

View File

@ -1,10 +1 @@
pub mod criterion {
//! This module re-exports the criterion API but picks the right backend depending on whether
//! the benchmarks are built to run locally or with codspeed
#[cfg(not(feature = "codspeed"))]
pub use criterion::*;
#[cfg(feature = "codspeed")]
pub use codspeed_criterion_compat::*;
}