-
perf(protect): the guard was spending a tenth of a core to discover nothing had changed · a828d5f0
219.1ms per 2s tick, 6 forks, with NOTHING running to protect. None of it was protection: three pgrep -x at 59ms each (pgrep reads cmdline for every process on the box, and it ran once per target), plus cat, two chrt -p reads and an unconditional prlimit per pid, each in its own command substitution. Now zero forks in the steady state: one bash pass over /proc/*/comm, sched from /proc/<pid>/stat fields 40/41, prlimit only when /proc/<pid>/limits says so. 28.5ms/tick, 1.42% of a core at the unchanged 2s interval. The interval is deliberately untouched -- the 7.7x came from forks alone, so the responsiveness that re-protects scsynth before its first sound was not traded for battery. Verified differentially against the old pgrep path with a decoy fleet (ardour9, ArdourGUI, ardour-8.6 must match; ardour-decoy, sclang-notreally, scsynthx and a bash whose path contains 'ardour' must not) and against chrt -p / cat on live scsynth+sclang. Needs sudo tools/install-protect.sh to take effect. Also logs two findings from the same measurement pass: sc-watchdog restarts SuperDirt on every clean start (6s patience vs 8s boot) and two starts in five minutes hit StartLimitBurst, leaving the rig unstartable; and the other two reconcile loops cost 5.3% between them with real event sources available.
PLN (Algolia) authoreda828d5f0
×