snix/tvix/scripts/bench.sh
Aspen Smith b2c8c1ef94 feat(tvix): Benchmark nixpkgs eval with hyperfine
Add some hyperfine benchmarks to Tvix's windtunnel benchmark script for
evaluating the outPath of hello and a cross-compiled hello.

Change-Id: I9d76e5ce0a3fd7d9c125c36c5fced675b660a8a8
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10248
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Autosubmit: grfn <grfn@gws.fyi>
2023-12-11 03:59:27 +00:00

18 lines
684 B
Bash
Executable file

#!/usr/bin/env nix-shell
#!nix-shell -i bash ../.. -A tvix.shell
# Benchmark script that runs inside the Windtunnel build agent
set -euo pipefail
echo "Running benchmarks for tvix/eval..."
cd "$(dirname "$(dirname "$0")")/eval"
cargo bench
windtunnel-cli report -f criterion-rust .
echo "Running tvix macrobenchmarks..."
cargo build --release --bin tvix
hyperfine --export-json ./results.json \
-n 'eval-nixpkgs-hello' "target/release/tvix -E '(import ../../nixpkgs {}).hello.outPath'" \
-n 'eval-nixpkgs-cross-hello' "target/release/tvix -E '(import ../../nixpkgs {}).pkgsCross.aarch64-multiplatform.hello.outPath'"
windtunnel-cli report -f hyperfine-json ./results.json