mirror of
https://github.com/luxfi/corona.git
synced 2026-07-27 02:50:34 +00:00
33 lines
901 B
Bash
33 lines
901 B
Bash
#!/usr/bin/env bash
|
|||
|
|
# Corona reproducible benchmarks.
|
||
|
|
#
|
||
|
|
# Runs the experimental-evaluation harness and writes results to
|
||
|
|
# bench/results/. Hardware fingerprint is captured so reviewers can
|
||
|
|
# compare. Per docs/mptc/evaluation.md.
|
||
|
|
|
||
|
|
set -euo pipefail
|
||
|
|
|
||
|
|
REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||
|
|
cd "$REPO_ROOT"
|
||
|
|
export GOWORK=off
|
||
|
|
|
||
|
|
OUT_DIR="bench/results"
|
||
|
|
mkdir -p "$OUT_DIR"
|
||
|
|
|
||
|
|
echo "==> hardware fingerprint"
|
||
|
|
{
|
||
|
|
uname -a
|
||
|
|
if command -v sysctl >/dev/null 2>&1; then
|
||
|
|
sysctl -a 2>/dev/null | grep -E 'machdep\.cpu\.brand_string|hw\.ncpu|hw\.memsize' || true
|
||
|
|
fi
|
||
|
|
if [[ -f /proc/cpuinfo ]]; then
|
||
|
|
grep -E 'model name|cpu MHz' /proc/cpuinfo | head -2
|
||
|
|
fi
|
||
|
|
go version
|
||
|
|
} > "$OUT_DIR/fingerprint.txt"
|
||
|
|
|
||
|
|
echo "==> Go benchmarks"
|
||
|
|
go test -bench=. -benchmem -count=3 -run=^$ -benchtime=2s ./... | tee "$OUT_DIR/go-bench.txt"
|
||
|
|
|
||
|
|
echo "==> done — results in $OUT_DIR/"
|