a73x

d71ca589

fix: install ReleaseSafe, so `yes` is not 600x slower than tmux

a73x   2026-08-21 12:30

Commit message
fix: install ReleaseSafe, so `yes` is not 600x slower than tmux

ghostty gates its page-integrity check on ITS OWN optimize mode, and the
check is not cheap: a hash map rebuilt over every cell plus a fresh
DebugAllocator, on every page mutation. `install` depended on `build`,
which is Debug, so ~/.local/bin got that. 20k lines of `yes` at 80x24,
no client attached: 3713ms installed, 6ms ReleaseSafe, 6ms tmux, 24ms a
bare pty. perf put 96% of muxd's cycles in verifyIntegrity and its hash
map.

The dev tree stays Debug on purpose — the integrity assertions are worth
having while working on the engine. Only what lands on PATH changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JDnJ6v15RvwZ2Y3zvfrWpR

Makefile
Old New
@@ -20,9 +20,22 @@ build:
20 # (ptyclient, wsclient, rawmode, ...) is a test fixture that would shadow 20 # (ptyclient, wsclient, rawmode, ...) is a test fixture that would shadow
21 # nothing useful on PATH. 21 # nothing useful on PATH.
22 BINDIR ?= $(HOME)/.local/bin 22 BINDIR ?= $(HOME)/.local/bin
23 install: build 23 # ReleaseSafe, like `release` — not the Debug tree `build` leaves in
24 # zig-out. ghostty gates its page-integrity check on ITS optimize mode, and
25 # in Debug that check rebuilds a hash map over every cell (and stands up a
26 # fresh DebugAllocator) on every page mutation: 20k lines of `yes` took
27 # 3713ms against 6ms ReleaseSafe, tmux 6ms. Nobody wants that on PATH.
28 #
29 # Staged in its own prefix because a `-Doptimize=` build would otherwise
30 # overwrite zig-out/bin, leaving the dev tree's binaries and test fixtures
31 # silently not the ones `make test` just built — the same trap xversion-build
32 # documents below.
33 INSTDIR ?= dist/install
34 install:
35 $(ZIG) build -Doptimize=ReleaseSafe -p $(INSTDIR)
24 install -d $(BINDIR) 36 install -d $(BINDIR)
25 install -m755 zig-out/bin/muxd zig-out/bin/mux zig-out/bin/muxa zig-out/bin/muxweb $(BINDIR)/ 37 install -m755 $(INSTDIR)/bin/muxd $(INSTDIR)/bin/mux \
38 $(INSTDIR)/bin/muxa $(INSTDIR)/bin/muxweb $(BINDIR)/
26 39
27 # The artifact a release publishes, built the way every release since 40 # The artifact a release publishes, built the way every release since
28 # v0.0.1-4 has been: static musl so one binary runs on any x86_64 Linux, 41 # v0.0.1-4 has been: static musl so one binary runs on any x86_64 Linux,