SOFTWARE ENGINEERING

Fast on a Cheap Phone: A Performance Lab

Ten days of measured fixes on a real kids’ game: web and native, low-end to high-end, every experiment kept or rejected

CURRICULUM

A hands-on performance course built from real work on Dunyati, a code-drawn kids’ game that runs on React Native (Skia) and the web (SVG). Measure first, then fix: frame budgets and device classes, zero-re-render native frames, forced layout, culling and adaptive quality, startup and world open, memory and an engine that sleeps, the experiments that failed, an invisible CSS cost, a canvas stage drawn by the native renderer, and the open performance ledger that recorded all 35 experiments. Every fix has a before/after recording and the design principles behind it.

  1. 01Measure Before You TouchA performance lab on a real product: Dunyati, a kids' world-building game that runs as a React Native app (Skia) and in the browser (SVG). Day 1 builds the instrument before touching any code: device classes, frame budgets, and a suite anyone can rerun.Published 08 Nov 20267 sections
  2. 02The Native Frame: Zero Re-renders, Fewer AllocationsOn iOS and Android the stage is drawn by Skia from React Native. Day 2 finds the two native costs that every frame paid twice over: React re-rendering the whole stage tree 60 times a second, and the renderer allocating and replaying work that never changes.Published 08 Nov 20267 sections
  3. 03Read, Then Write: Forced Layout, Pointer Storms and the SpotlightThe web stage is an SVG the engine rewrites every frame. Day 3 finds three costs that no line of code looks guilty of: a layout read after a write, a pointer handler that ran four times per frame on fast screens, and a beautiful spotlight filter that was re-rasterised every frame.Published 08 Nov 20267 sections
  4. 04Paint Less: Culling, Adaptive Quality and Raster TilesA wide world holds thousands of SVG nodes and the child sees one screen of them. Day 4 makes the browser stop walking, painting and allocating for what nobody can see, without changing a single visible pixel.Published 08 Nov 20268 sections
  5. 05Start Fast: Kit Build, World Open and Lazy SceneryFrame rate is what a child feels while playing; start-up is what decides whether they get to play. Day 5 turns two silent waits, building the object catalogue and opening a world, into measured rails, and cuts them from seconds to a fraction.Published 08 Nov 20267 sections
  6. 06Memory and Sleep: Leak Checks and an Engine That RestsA low-end phone has little memory as well as a slow CPU, and an engine that updates 90 objects when the child can see five wastes both. Day 6 adds memory to every measurement, proves there is no leak, and lets far-away objects sleep.Published 08 Nov 20267 sections
  7. 07The Experiments That Failed (and Why They Are Worth Keeping)Five of the 35 experiments in this lab were rejected. Day 7 walks through each: what it promised, how it was measured, why it failed, and what the failure taught. A rejected experiment with its numbers is the cheapest result you will ever get.Published 08 Nov 20268 sections
  8. 08Find the Invisible Cost: a CSS Animation and a Shared Paint LayerTwo of the biggest wins in the lab came from code nobody suspected: two bouncing navigation arrows, and the order of layers inside one SVG. Day 8 shows the instruments that found them and why each fix changes nothing a child can see.Published 08 Nov 20266 sections
  9. 09Draw It Yourself: a Canvas Stage with the Native RendererAfter Day 8, the moving objects were about half of every low-end frame's paint: as SVG, the browser re-records and re-rasterises every visible object's parts each frame. Day 9 draws them on one canvas with the renderer the native app already ships, keeps every accessibility and testing contract, and decides with data where the canvas should run.Published 08 Nov 20269 sections
  10. 10The Performance Ledger: Record, Compare, MergeEvery number in this course came out of one file: a ledger of 35 experiments, kept and rejected, with their raw results checked in beside it. Day 10 shows how the ledger works, how it was used every day, the bug it caught in itself, and how it became a small open-source tool designed with SRP, DI, IoC, MVC and pub/sub.Published 08 Nov 20267 sections