mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-28 20:34:07 +08:00
benchmarks: Do hyperfine first
Helps with warmup
This commit is contained in:
parent
07c09bdee2
commit
0ede48e024
|
@ -21,6 +21,17 @@ quote() {
|
||||||
|
|
||||||
for benchmark in "$BENCHMARKS_DIR"/*; do
|
for benchmark in "$BENCHMARKS_DIR"/*; do
|
||||||
basename "$benchmark"
|
basename "$benchmark"
|
||||||
|
# If we have hyperfine, use it first to warm up the cache
|
||||||
|
if command -v hyperfine >/dev/null 2>&1; then
|
||||||
|
cmd1="$(quote "${FISH_PATH}") --no-config $(quote "$benchmark")"
|
||||||
|
if [ -n "$FISH2_PATH" ]; then
|
||||||
|
cmd2="$(quote "${FISH2_PATH}") --no-config $(quote "$benchmark")"
|
||||||
|
hyperfine --warmup 3 "$cmd1" "$cmd2"
|
||||||
|
else
|
||||||
|
hyperfine --warmup 3 "$cmd1"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
[ -n "$FISH2_PATH" ] && echo "$FISH_PATH"
|
[ -n "$FISH2_PATH" ] && echo "$FISH_PATH"
|
||||||
"${FISH_PATH}" --print-rusage-self "$benchmark" > /dev/null
|
"${FISH_PATH}" --print-rusage-self "$benchmark" > /dev/null
|
||||||
if [ -n "$FISH2_PATH" ]; then
|
if [ -n "$FISH2_PATH" ]; then
|
||||||
|
@ -28,14 +39,5 @@ for benchmark in "$BENCHMARKS_DIR"/*; do
|
||||||
"${FISH2_PATH}" --print-rusage-self "$benchmark" > /dev/null
|
"${FISH2_PATH}" --print-rusage-self "$benchmark" > /dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if command -v hyperfine >/dev/null 2>&1; then
|
|
||||||
cmd1="$(quote "${FISH_PATH}") --no-config $(quote "$benchmark")"
|
|
||||||
if [ -n "$FISH2_PATH" ]; then
|
|
||||||
cmd2="$(quote "${FISH2_PATH}") --no-config $(quote "$benchmark")"
|
|
||||||
hyperfine "$cmd1" "$cmd2"
|
|
||||||
else
|
|
||||||
hyperfine "$cmd1"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user