Sort the benchmarks before listing them (#2026)

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
Oliver Tale-Yazdi
2023-10-25 14:46:49 +02:00
committed by GitHub
parent b7a8532db1
commit c86b633695
@@ -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));