Monorepo for Aesthetic.Computer aesthetic.computer

Time the sim instead of the instrument watching it master

perf-record was reporting probe.mjs's number, and that number is not the simulation. Its timed pass snapshots the world, canonicalizes it and SHA-256s it on every tick — about 30 µs against a sim that costs 21, so two thirds of the figure was the harness measuring itself. All that per-tick allocation also drives GC, which is where the 20-50% run-to-run spread came from; timing the bare loop lands inside a few percent. That spread was not cosmetic. It hid everything: a sweep across the eleven commits since 2fcb1b6f4 could not attribute the drift to any of them, and once flagged a commit at +42% whose successors measured faster, which is impossible. Timed bare, the same sweep is legible — 9.09 µs at the baseline against 21.00 at HEAD, bought by three commits: the framing and movement rebuild (+37%), making the entry screen a live fight (+36%), and folding diagnostics into the world (+11%). So the sim costs a third of what we believed, against a 16,667 µs tick: roughly 1000 real-time authoritative matches per core rather than 330. It was never near the budget, and it is not the thing to optimize. Two smaller corrections fall out. V8 has to see the sim hot before its numbers mean anything, so two warmup passes are thrown away rather than averaged in. And a reading now carries the metric that produced it, so these cannot be diffed against the older instrumented rows already in the ledger — a comparison that read as a 42% improvement and was only a change of ruler.


+62 -15
1 changed file