diff --git a/crates/cargo-codspeed/src/app.rs b/crates/cargo-codspeed/src/app.rs index 27767efb..c3f18891 100644 --- a/crates/cargo-codspeed/src/app.rs +++ b/crates/cargo-codspeed/src/app.rs @@ -61,6 +61,10 @@ enum Commands { #[arg(long)] no_default_features: bool, + /// Number of parallel jobs, defaults to # of CPUs. + #[arg(short, long)] + jobs: Option, + /// Build the benchmarks with the specified profile #[arg(long, default_value = "release")] profile: String, @@ -84,6 +88,7 @@ pub fn run(args: impl Iterator) -> Result<()> { filters, features, all_features, + jobs, no_default_features, profile, } => { @@ -98,6 +103,10 @@ pub fn run(args: impl Iterator) -> Result<()> { passthrough_flags.push("--no-default-features".to_string()); } + if let Some(jobs) = jobs { + passthrough_flags.push(format!("--jobs={jobs}")); + } + passthrough_flags }; let features =