Download this file
| 1 | #!/usr/bin/env bash |
| 2 | # Memory for each app, measured locally because Carloku doesn't show members |
| 3 | # memory figures (carlos/platform #365): builds the app's own host binary |
| 4 | # (make build -> dist/app), runs it on 127.0.0.1 with a fresh database, |
| 5 | # and records resident memory at rest, at peak under load, and after. |
| 6 | # Run with nothing else heavy on the machine. |
| 7 | # scripts/measure-memory.sh [slug...] |
| 8 | set -uo pipefail |
| 9 | cd "$(dirname "$0")/.." |
| 10 | source scripts/env.sh |
| 11 | ulimit -n 8192 2>/dev/null || true |
| 12 | slugs=("$@") |
| 13 | [ ${#slugs[@]} -gt 0 ] || slugs=(go go-rastrillo rust zig ocaml haskell swift nim spinel) |
| 14 | for s in "${slugs[@]}"; do |
| 15 | dir=.worktrees/$s/apps/$s |
| 16 | (cd "$dir" && make build >/dev/null 2>&1) || { echo "$s: make build failed"; continue; } |
| 17 | bakeoff memory --slug "$s" --dir "$dir" --duration 10s || echo "$s: memory measurement failed" |
| 18 | done |
| 19 | |