diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-10-10 11:34:26 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-10-10 11:34:26 -0400 |
commit | 8719b66e6f0c5aac71e5245490269d4a644f6fe1 (patch) | |
tree | 6ad78f1cf28392ddecfbc8a56acfee2441242e6f | |
parent | cad3a75f16a4f970e96830359cb62f3802ec0b6c (diff) | |
download | bfs-8719b66e6f0c5aac71e5245490269d4a644f6fe1.tar.xz |
bench: Group by strategy in comparison mode
-rw-r--r-- | bench/bench.sh | 17 |
1 files 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 |