bench: add hyperfine wrapper

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
balanza
2026-06-20 14:14:15 +02:00
co-authored by Claude Opus 4.7
parent 508d9c86ec
commit 09d9902e14
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# hyperfine invocation wrapper.
hyperfine_run() {
local out_json="$1" warmup="$2" runs="$3" cmd="$4"
hyperfine \
--warmup "$warmup" \
--runs "$runs" \
--export-json "$out_json" \
--shell=none \
-- "$cmd" >/dev/null
}
hyperfine_mean_seconds() {
jq -r '.results[0].mean' "$1"
}
hyperfine_stddev_seconds() {
jq -r '.results[0].stddev' "$1"
}