mirror of
https://github.com/89luca89/distrobox.git
synced 2026-08-19 01:14:49 -05:00
bench: add hyperfine wrapper
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
508d9c86ec
commit
09d9902e14
@@ -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"
|
||||
}
|
||||
Reference in New Issue
Block a user