-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbm
More file actions
executable file
·44 lines (36 loc) · 2.07 KB
/
bm
File metadata and controls
executable file
·44 lines (36 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
# =============================================================================
# BLIP Benchmark Suite
# =============================================================================
# Runs both the Zig microbenchmarks (encoding/decoding) and the archive
# creation benchmarks (expansion, serialization, streaming).
#
# Results are logged to bench/*.jsonl (git-tracked) for historical comparison.
# =============================================================================
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
echo "╔══════════════════════════════════════════════════════════════╗"
echo "║ BLIP Benchmark Suite ║"
echo "╚══════════════════════════════════════════════════════════════╝"
echo ""
# Build everything optimized
echo "Building (ReleaseFast)..."
nix develop -c zig build -Doptimize=ReleaseFast 2>/dev/null
# Check for DEBUG BUILD
if zig-out/bin/blar --about 2>&1 | grep -qi "DEBUG BUILD"; then
echo ""
echo "╔══════════════════════════════════════════════════════════════╗"
echo "║ ERROR: DEBUG BUILD detected. Benchmarks require Release. ║"
echo "╚══════════════════════════════════════════════════════════════╝"
exit 1
fi
# Run Zig encoding benchmarks
echo ""
echo "━━━ Zig Encoding Benchmarks ━━━"
nix develop -c zig build bench -Doptimize=ReleaseFast 2>/dev/null || true
# Run archive creation benchmarks
echo ""
echo "━━━ Archive Creation Benchmarks ━━━"
bash bench/archive_bench.sh
echo ""
echo "Done. Results in bench/*.jsonl"