From 8719b66e6f0c5aac71e5245490269d4a644f6fe1 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 10 Oct 2023 11:34:26 -0400 Subject: bench: Group by strategy in comparison mode --- bench/bench.sh | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/bench/bench.sh b/bench/bench.sh index 1294fd1..8fe5ab9 100644 --- a/bench/bench.sh +++ b/bench/bench.sh @@ -419,11 +419,20 @@ bench-print() { bench-strategies-corpus() { subgroup '%s' "$1" - for bfs in "${BFS[@]}"; do - subsubgroup '%s' "$bfs" - cmds=("$bfs -S "{bfs,dfs,ids,eds}" $2 -false") + if ((${#BFS[@]} == 1)); then + cmds=("$BFS -S "{bfs,dfs,ids,eds}" $2 -false") do-hyperfine "${cmds[@]}" - done + else + for S in bfs dfs ids eds; do + subsubgroup '`-S %s`' "$S" + + cmds=() + for bfs in "${BFS[@]}"; do + cmds+=("$bfs -S $S $2 -false") + done + do-hyperfine "${cmds[@]}" + done + fi } # All search strategy benchmarks -- cgit v1.2.3