Skip to content

fix(cargo-codspeed): forward args after -- to bench binaries#179

Open
not-matthias wants to merge 1 commit into
mainfrom
cod-2646-execution-of-rust-benchmarks-using-exact-doesnt-work
Open

fix(cargo-codspeed): forward args after -- to bench binaries#179
not-matthias wants to merge 1 commit into
mainfrom
cod-2646-execution-of-rust-benchmarks-using-exact-doesnt-work

Conversation

@not-matthias
Copy link
Copy Markdown
Member

Summary

  • cargo codspeed run -- --exact <name> failed with unexpected argument '--exact' found because the Run subcommand had no trailing-args field.
  • Add a bench_args field with clap's last = true and forward those args to each bench command, mirroring cargo bench behavior.

Fixes COD-2646.

Test plan

  • New test test_criterion_walltime_run_forwards_args_after_double_dash builds the criterion fixture in walltime mode and runs with -- --exact "fib 20", asserting only fib 20 appears in stdout while both suites still finish.
  • cargo test --test simple-criterion passes.

`cargo codspeed run -- --exact <name>` previously failed with
`unexpected argument '--exact' found` because the `Run` subcommand had
no trailing-args field. Add a `bench_args` field with `last = true` and
forward it to each bench command, mirroring `cargo bench` behavior.
@not-matthias not-matthias marked this pull request as ready for review May 12, 2026 18:55
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 12, 2026

Merging this PR will degrade performance by 29.18%

⚡ 6 improved benchmarks
❌ 3 regressed benchmarks
✅ 566 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime from_elem_decimal[1024] 86 ns 81 ns +6.17%
WallTime iter_with_setup 40 ns 44 ns -9.09%
WallTime hamiltonian_cycle[4] 1,727 ns 803 ns ×2.2
WallTime graph_coloring[6] 1.5 µs 1.2 µs +30.97%
WallTime generate_combinations[5] 1.2 µs 1.7 µs -29.18%
WallTime generate_combinations[6] 2.7 µs 2.1 µs +31.59%
WallTime hamiltonian_cycle[5] 1,415 ns 899 ns +57.4%
WallTime graph_coloring[4] 1,319 ns 965 ns +36.68%
WallTime fib_10 386 ns 455 ns -15.16%

Comparing cod-2646-execution-of-rust-benchmarks-using-exact-doesnt-work (6072a98) with main (0c6ccae)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant