Skip to content

Commit 753f61c

Browse files
bench_tools: add criterion benchmark names to benchmark config (#9697)
1 parent 1800f78 commit 753f61c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

crates/bench_tools/src/types/benchmark_config.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ pub struct BenchmarkConfig {
77
/// Optional input directory path relative to workspace root. If set, inputs will be
88
/// downloaded from GCS before running the benchmark.
99
pub input_dir: Option<&'static str>,
10+
/// Optional list of Criterion benchmark names that this benchmark suite produces.
11+
/// If None, assumes a single benchmark with the same name as the config.
12+
/// Used for regression checking to know which criterion directories to check.
13+
pub criterion_benchmark_names: Option<&'static [&'static str]>,
1014
}
1115

1216
impl BenchmarkConfig {
@@ -28,24 +32,33 @@ pub const BENCHMARKS: &[BenchmarkConfig] = &[
2832
package: "starknet_committer_and_os_cli",
2933
cmd_args: &["bench", "-p", "starknet_committer_and_os_cli", "full_committer_flow"],
3034
input_dir: Some("crates/starknet_committer_and_os_cli/test_inputs"),
35+
criterion_benchmark_names: None, // Single benchmark with same name.
3136
},
3237
BenchmarkConfig {
3338
name: "single_tree_flow",
3439
package: "starknet_committer_and_os_cli",
3540
cmd_args: &["bench", "-p", "starknet_committer_and_os_cli", "single_tree_flow"],
3641
input_dir: Some("crates/starknet_committer_and_os_cli/test_inputs"),
42+
criterion_benchmark_names: None, // Single benchmark with same name.
3743
},
3844
BenchmarkConfig {
3945
name: "gateway_apply_block",
4046
package: "apollo_gateway",
4147
cmd_args: &["bench", "-p", "apollo_gateway", "apply_block"],
4248
input_dir: None,
49+
criterion_benchmark_names: None, // Single benchmark with same name.
4350
},
4451
BenchmarkConfig {
4552
name: "dummy_benchmark",
4653
package: "bench_tools",
4754
cmd_args: &["bench", "-p", "bench_tools", "--bench", "dummy_bench"],
4855
input_dir: Some("crates/bench_tools/data/dummy_bench_input"),
56+
criterion_benchmark_names: Some(&[
57+
"dummy_sum_100",
58+
"dummy_sum_1000",
59+
"dummy_process_small_input",
60+
"dummy_process_large_input",
61+
]),
4962
},
5063
];
5164

0 commit comments

Comments
 (0)