#!/usr/bin/env bash # Full PEP-36 matrix. BENCH_PG_URL must point at the throwaway peppa_bench database. # BENCH_PG_URL=postgres://…/peppa_bench ./matrix.sh [smoke] set -u cd "$(dirname "$0")" DUR1=${DUR1:-90}; DUR10=${DUR10:-60} run() { node run.ts "$@" 2>&1 | grep -vE "^\[bench\]"; } if [ "${1:-}" = smoke ]; then for b in "--backend bun --notify push" "--backend writer --notify push" "--backend node --notify fswatch" "--backend pg"; do run $b --runners 3 --load 5 --duration 12 --name smoke | grep -E "==|write ALL|deliver|rror" done exit fi # 1. Write contention: every backend at 10/20 runners, real load (x1) and x10. for r in 10 20; do for x in 1 10; do d=$([ $x = 1 ] && echo $DUR1 || echo $DUR10) run --backend bun --runners $r --load $x --duration $d --notify poll:1000 run --backend node --runners $r --load $x --duration $d --notify poll:1000 run --backend better --runners $r --load $x --duration $d --notify poll:1000 run --backend writer --runners $r --load $x --duration $d --notify push run --backend pg --runners $r --load $x --duration $d --notify pg done done # 2. LISTEN/NOTIFY replacements on bun:sqlite, 20 runners x10. for n in poll:200 poll:1000 fswatch push; do run --backend bun --runners 20 --load 10 --duration $DUR10 --notify $n done # 3. Saturation: 20 runners at x50 (≈ 100 hook processes/s) — where does each one bend? for b in "--backend bun --notify poll:1000" "--backend writer --notify push" "--backend pg --notify pg"; do run $b --runners 20 --load 50 --duration 45 done