Skip to content

Commit

Permalink
Sort the benchmarks before listing them (#2026)
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez authored Oct 25, 2023
1 parent b7a8532 commit c86b633
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion substrate/utils/frame/benchmarking-cli/src/pallet/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -748,13 +748,17 @@ impl CliConfiguration for PalletCmd {

/// List the benchmarks available in the runtime, in a CSV friendly format.
fn list_benchmark(
benchmarks_to_run: Vec<(
mut benchmarks_to_run: Vec<(
Vec<u8>,
Vec<u8>,
Vec<(BenchmarkParameter, u32, u32)>,
Vec<(String, String)>,
)>,
) {
// Sort and de-dub by pallet and function name.
benchmarks_to_run.sort_by(|(pa, sa, _, _), (pb, sb, _, _)| (pa, sa).cmp(&(pb, sb)));
benchmarks_to_run.dedup_by(|(pa, sa, _, _), (pb, sb, _, _)| (pa, sa) == (pb, sb));

println!("pallet, benchmark");
for (pallet, extrinsic, _, _) in benchmarks_to_run {
println!("{}, {}", String::from_utf8_lossy(&pallet), String::from_utf8_lossy(&extrinsic));
Expand Down

0 comments on commit c86b633

Please sign in to comment.