The hotspot that wasn’t where we looked: measuring before we cut

← All field notes

By late May the test world held a couple of thousand living plants, and four of the busiest scenes had slipped into the high forties — just under the frame rate where the world should hold steady. The obvious thing to blame was the drawing: all those plants, redrawn every frame. So we did the one thing that obvious answers most need, and the least often get. We measured first.

The suspect we were sure of

It’s a calm game on purpose — a golden-hour world you’re meant to sit with and watch breathe, not one you fight. That only works if the frame rate stays smooth, so we set a plain floor: every test scene had to clear at least 50 frames per second, hold around 55 comfortably, and reach 60 where it could. Four of the five plant-heavy scenes were failing that floor, sitting in the high forties. The world had just grown its first long-lived tree — the canopy oak that turned a field of grass into something closer to woodland — and the extra plants it brought were the load that finally pushed those scenes over the edge. (That arrival is its own story; here it’s just the weight that exposed the slowdown.)

The reflex was to blame the rendering. A couple of thousand plants, each redrawn on screen sixty times a second — surely that was where the time went. It’s the natural suspect precisely because it’s visible: you can see all those plants, so it feels expensive. We were close to simply attacking it.

Instead we built a small instrument that timed each part of a frame and printed a sorted breakdown of where the budget actually went. Each frame has only about a sixtieth of a second to do everything, and we wanted to know how that sliver was being spent before we changed a line. The one rule we held to while building it: the measuring must not disturb the thing it measures.

The measurement does not perturb what it measures.

What the profile actually said

The drawing was cheap. Rebuilding the on-screen plant visuals cost a fraction of a millisecond a frame — a rounding error against the budget. The suspect we’d been ready to chase was innocent.

The real cost was somewhere much quieter: the slow loop that advances every plant through its life — growing, dying, scattering seed — was eating about a quarter of every frame’s budget. Redrawing the world was nearly free; thinking about the world was where the time went. That alone reframed the whole problem. We weren’t looking at a graphics cost at all.

An aerial golden-hour view of a dense voxel meadow full of grass and young trees, bathed in soft warm light with gentle haze in the distance.Concept art · pre‑alpha
Thousands of plants, each quietly living its life — the drawing was cheap; the thinking was where the time went.

The hotspot inside the hotspot

Then we looked closer at that update loop, and found the actual culprit hiding in plain sight — not the big thing we’d feared, but a small thing done far too often.

The loop doesn’t process every plant at once; it works through them a slice at a time, to stay inside the frame budget. (That slicing has a story of its own — here it’s just the shape the work arrives in.) On every slice, the loop was rebuilding, from scratch, a little tally of how many living plants of each kind there were — walking the entire population to count them, again and again. At a couple of thousand plants, across all the slices in a single pass, that added up to something on the order of three hundred and fifty thousand redundant counting steps. A tiny piece of bookkeeping, run a third of a million times where it needed to run once.

The fix was almost embarrassingly plain. Compute that tally once, at the start of each pass, and hand the same answer to every plant — instead of recomputing it for each one.

What made it safe is a property of the simulation, not a gamble. Within a single pass, the set of living plants doesn’t change: new seedlings are held aside until the pass boundary, so nothing is born or removed mid-pass. The count is therefore the same every time you ask — which means computing it once gives exactly the answer that recomputing it constantly would have given, only without the wasted walks. We weren’t approximating to go faster. We were deleting work that was provably redundant.

Proving it changed nothing

The change itself took minutes. The hard part — the part that earns the right to ship a speedup — was proving the faster world was the same world.

The simulation is built to replay byte-for-byte identically from the same seed, and we lean on that here: we ran the world before the change and after it, and checked that the saved state came out identical down to its fingerprint, not one bit moved. It didn’t. (The machinery that makes that comparison trustworthy is a longer tale; what matters here is that we used it as the verdict.) A speedup only counts if it’s invisible to the world — same outcomes, same saves, just sooner.

A faster way to get a different world is not an optimization.

And because a quiet regression is the kind that rots in slowly, a handful of always-on checks now re-confirm both halves of the bargain: that the world still replays identically, and that the frame rate stays above its floor. The optimization can’t silently break what it was meant to protect.

What it bought

The plant update fell by about a third — from roughly a quarter of the frame’s budget down to about a sixth. That was enough. All four marginal scenes climbed clear of the floor and into the mid-to-high fifties, and two of them reached a full 60. The world you sit and watch holds steady again.

But the number wasn’t really the point. The point was headroom. Some costs you can’t optimize away the same way — drawing, the interface, streaming the world in as you move; that’s the floor the frame will always pay. The plant update wasn’t the floor, and buying it back cheaply leaves room above it for the things we still want to add: more plant species, the turning of seasons, richer tree rendering. Each will spend some of that headroom. The job of this pass was to make sure there was headroom to spend.


We almost spent a week making the drawing faster — the one part of the frame that was already fast. The profile cost us an afternoon and pointed at a counter being rebuilt three hundred thousand times for no reason. That trade — an afternoon of honest measurement against a week of confident guessing — is the whole lesson, freshly earned. The hotspot is almost never where you’re sure it is. Look before you cut.

Keep reading

Concept art · pre‑alpha