diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2023-10-12 18:21:55 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2023-10-12 18:22:20 -0400 |
commit | 11feab9496ef610fa01f088155549b4d2d5e5c08 (patch) | |
tree | c6d1744be4b39f1869837a4cc674dd52d19697f5 /bench | |
parent | d64a32e03b4d9a1336ebfa66d7d08d96e9847a6a (diff) | |
download | bfs-11feab9496ef610fa01f088155549b4d2d5e5c08.tar.xz |
bench: Check for bfs -j support before using it
Diffstat (limited to 'bench')
-rw-r--r-- | bench/bench.sh | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/bench/bench.sh b/bench/bench.sh index be5a15b..ab56b79 100644 --- a/bench/bench.sh +++ b/bench/bench.sh @@ -467,7 +467,11 @@ bench-jobs-corpus() { if ((${#BFS[@]} + ${#FD[@]} == 1)); then cmds=() for bfs in "${BFS[@]}"; do - cmds+=("$bfs -j"{1,2,3,4,6,8,12,16}" $2 -false") + if "$bfs" -j1 -quit &>/dev/null; then + cmds+=("$bfs -j"{1,2,3,4,6,8,12,16}" $2 -false") + else + cmds+=("$bfs $2 -false") + fi done for fd in "${FD[@]}"; do @@ -481,14 +485,20 @@ bench-jobs-corpus() { cmds=() for bfs in "${BFS[@]}"; do - cmds+=("$bfs -j$j $2 -false") + if "$bfs" -j1 -quit &>/dev/null; then + cmds+=("$bfs -j$j $2 -false") + elif ((j == 1)); then + cmds+=("$bfs $2 -false") + fi done for fd in "${FD[@]}"; do cmds+=("$fd -j$j -u '^$' $2") done - do-hyperfine "${cmds[@]}" + if ((${#cmds[@]})); then + do-hyperfine "${cmds[@]}" + fi done fi } |