Skip to content

Commit d2d86b8

Browse files
committed
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.
1 parent 8720306 commit d2d86b8

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎Cargo.toml‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,13 @@ rustls-graviola = { workspace = true }
6868
rustpython-stdlib = { workspace = true }
6969
ruff_python_parser = { workspace = true }
7070

71+
# Only the criterion benchmarks below are measured. Without `bench = false`,
72+
# `cargo bench` (and `cargo codspeed build`) also builds the library and binary
73+
# unit-test harnesses with the LTO bench profile, adding a full extra link of
74+
# the interpreter that is never run.
75+
[lib]
76+
bench = false
77+
7178
[[bench]]
7279
name = "execution"
7380
harness = false
@@ -79,6 +86,7 @@ harness = false
7986
[[bin]]
8087
name = "rustpython"
8188
path = "src/main.rs"
89+
bench = false
8290

8391
[[example]]
8492
name = "custom_tls_providers"

0 commit comments

Comments
 (0)