
How we made a 2D renderer 2-4x faster
The research behind spryte: what profiling found, why a bulk API and an 8-byte instance format were the breakthrough, and how output was checked per pixel.
In-depth technical articles: how things work in the browser, measured, with methods and data you can reproduce. For how-tos and comparisons, see the blog.

The research behind spryte: what profiling found, why a bulk API and an 8-byte instance format were the breakthrough, and how output was checked per pixel.

Three V8 behaviours that cost spryte's draw.sprite path time (Math.round, the inlining budget and object shapes), what each was worth in 2dbench, and the test that keeps the fix in place.

debuff's effects package has 94% line coverage. Henka made 266 small changes to it and 132 passed every test. Read one by one, 69 are real gaps in code the tests run, including particles that fly backwards.

A -6 dB wall took 14.4 dB off white noise and 23.7 dB off its treble. Offline renders of Earshot's wall, room and cave settings, with the method.

Fine-tuning the encoder of a small text classifier lost 2.5 points on BANKING77. Changing how the head is fitted gained 2.5, with the same 34 MB model and training still in the browser.

LLM labels with 15% errors barely hurt a small classifier's accuracy but wreck its confidence, so it never stops asking. Two fixes, measured on BANKING77, CLINC150 and real Llama 3.1 8B answers.

We measured how 12 popular JavaScript CLIs fail. 10 reject an unknown option, but only 2 give it its own exit code, and 1 of 7 JSON modes still prints JSON when the tool can't run.

Notes started from the frame loop drift by 10-30 ms and pile up after a freeze. Notes scheduled ahead on the audio clock, as plonk does, land exactly.

How 2dbench keeps a renderer benchmark fair: shared simulation, a pixel-parity gate, GPU-complete timing, interleaved rounds and declared conflicts of interest.
How 2dbench draws a retro raycaster as 2D texture slices, why that stress-tests sprite renderers, and how spryte and PixiJS handle quads from all over an atlas.

spryte's architecture next to PixiJS 8's: immediate mode versus a scene graph, GPU instancing versus CPU-built vertices, and a pixel-matched Canvas 2D fallback.

Chrome's Long Animation Frames API names the script behind a slow frame. Its two catches for games, and how Myaku turns entries into verdicts on a Phaser game.