From 363612849947e06cf76821e0f3d89e48213e2bea Mon Sep 17 00:00:00 2001 From: CodSpeed Bot Date: Fri, 16 Oct 2026 18:03:57 +0000 Subject: [PATCH] Skip unit-test harnesses when building benchmarks cargo bench and cargo codspeed build select every target with bench = true. That includes the library and binary targets, so the build also compiled the library unit-test harness as an extra LTO-linked copy of the interpreter that no benchmark runs. Mark them bench = false so only the criterion benchmarks (and the binary they depend on) are built. --- Cargo.toml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 4356442fada..6d716c525d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,6 +68,13 @@ rustls-graviola = { workspace = true } rustpython-stdlib = { workspace = true } ruff_python_parser = { workspace = true } +# Only the criterion benchmarks below are measured. Without `bench = false`, +# `cargo bench` (and `cargo codspeed build`) also builds the library and binary +# unit-test harnesses with the LTO bench profile, adding a full extra link of +# the interpreter that is never run. +[lib] +bench = false + [[bench]] name = "execution" harness = false @@ -79,6 +86,7 @@ harness = false [[bin]] name = "rustpython" path = "src/main.rs" +bench = false [[example]] name = "custom_tls_providers"