simulife-rs
Client-server evolutionary cellular automaton, optimized from captured Chrome traces rather than guesswork.
Implementation AI-generated. I designed the architecture, chose the approach, and directed the engineering decisions; the code itself was generated rather than hand-written. Noted here so the nature of the work is clear up front.

- Server throughput
- 35.5 → 68.6 tps
- World-pruning phase
- 59.3ms → 1.4ms
- Ticks dropped before encode
- 22% → ~0%
- Idle frames, 8s capture
- 9,637 → 73
A distributed evolutionary cellular automaton built as a testbed for real-time networking, GPU rendering, and — the actual point of the exercise — performance methodology. I directed the architecture, set the measurement approach, and did the trace analysis; the implementation was AI-generated.
Measure first
Chrome-trace instrumentation is built into both the server and the viewer, alongside a CLI trace summarizer. Every optimization below started from a captured timeline, not from a guess about where the time was going.
What the traces found
Two async tasks had coalesced onto a single worker thread. This was the find that justified the instrumentation. Nothing about the code reads as wrong, no single function is slow, and no profile sorted by self time points at it — the tasks were simply running one after another instead of alongside each other. It is visible in a timeline and essentially invisible everywhere else. Separating them raised server throughput from 35.5 to 68.6 ticks per second.
A world-pruning phase was rescanning the entire world repeatedly. Replacing the rescan with a strict cell-locality rule made updates order-independent and cut the phase from 59.3ms to 1.4ms.
The viewer was redrawing far more than it needed to when idle. Redraw events were being fed back into egui as input, which kept it requesting further repaints. Moving to event-driven repaint took an 8-second capture of a static scene from 9,637 frames to 73. The full picture here is messier than one number suggests, but the direction was clear enough to act on.
Transport
QUIC with msgpack serialization and multithreaded zstd compression. Snapshots are handed to the encoder latest-wins, so the simulation never blocks on the network. Faster encoding cut the share of ticks dropped before encode from 22% to near zero.