# Benchmarks

Numbers here are measured, with the method and raw results in the open, so you can check them on your own hardware.

## Renderer: spryte against PixiJS

debuff draws through [spryte](https://github.com/debuffjp/spryte), its standalone renderer. The comparison uses the same deterministic simulation and the same 16x16 textures for every renderer. Each frame is timed from simulation through GPU completion, so vsync can't hide cost. Every result is the median of 3 interleaved rounds. Before any timing, a **pixel-parity gate** checks every renderer draws the same scene at 2,000 and at 50,000 sprites: the run fails if any renderer's drawn area differs by more than 0.5%, or if pixels differ *inside* sprites. How spryte got this fast, from the first profile to the 8-byte instance format: [How spryte got fast](/research/how-spryte-got-fast).

![Sprites at 60 fps: spryte draw.sprites 1.6M, PixiJS ParticleContainer 400k, spryte draw.sprite 200k, PixiJS Sprite 50k, Canvas 2D 10k](/shots/bench.svg)

### Like for like

| Workload | spryte | PixiJS 8 | spryte is |
| --- | --- | --- | --- |
| Dynamic particles (position, scale, rotation, tint and alpha all changing per particle), 200k | **6.0 ms** (`draw.sprites`) | 19.8 ms (`ParticleContainer`, those properties dynamic) | **3.3x faster** |
| Sprites with changing rotation, scale, tint and alpha, 4 textures, 50k | **3.9 ms** (`draw.sprite`) | 17.5 ms (`Sprite`) | **4.5x faster** |
| Bunnymark (position only), 50k | **3.3 ms** (`draw.sprite`) | 10.3 ms (`Sprite`) | **3.1x faster** |
| Bunnymark, bulk, 200k | **2.7 ms** (`draw.sprites`) | 6.4 ms (`ParticleContainer`) | **2.4x faster** |

### Most sprites at 60 fps

| | spryte | PixiJS 8 |
| --- | --- | --- |
| Bulk, position only | **1,600,000** | 400,000 (`ParticleContainer`) |
| Dynamic particles | **400,000** | 100,000 (`ParticleContainer`) |
| One call per sprite, bunnymark | **200,000** | 50,000 (`Sprite`) |
| One call per sprite, dynamic particles | **100,000** | 20,000 (`Sprite`) |
| One call per sprite, mixed | **200,000** | 20,000 (`Sprite`) |
| Raw Canvas 2D `drawImage` | 10,000 | |

debuff's `Game` adds nothing measurable on top of spryte (6.0 against 5.8 ms at 50k in an earlier run, within noise).

*2026-11-11, measured with [2dbench](https://github.com/debuffjp/2dbench), 3-7 interleaved rounds per scene: Windows 11, Chrome 157, NVIDIA RTX 5060 Laptop GPU (ANGLE / Direct3D 11), AMD Ryzen 7 260, on AC power, power plan Turbo. spryte 0.13.0, PixiJS 8.22.0. The spryte 0.7.2 run of 2026-10-28 had 6.3 against 23.5 ms (dynamic particles) and 5.5 against 20.2 ms (mixed), and the spryte 0.2.1 run of 2026-10-20 had 5.8 against 24.2 ms (dynamic particles) and 7.8 against 27.1 ms (mixed). Full results with min-max ranges: [spryte benchmarks](https://github.com/debuffjp/spryte/blob/main/docs/benchmarks.md).*

### Across devices

The same comparison in [2dbench](https://github.com/debuffjp/2dbench), on every device submitted so far: dynamic particles, one draw call per sprite (`draw.sprite` against `Sprite`), most sprites at 60 fps and how much faster spryte's frame was at 50k sprites (10k on the Android phone).

| Device | Browser | spryte | PixiJS | spryte faster |
| --- | --- | --- | --- | --- |
| Laptop, NVIDIA RTX 5060 | Chrome 157, Windows | 100,000 | 20,000 | 3.8x |
| Lenovo Legion Pro 7, NVIDIA RTX 4080 | Chromium 156, Linux | 100,000 | 50,000 | 2.7x |
| Laptop, AMD Radeon 780M (integrated) | Chrome, Windows | 50,000 | 20,000 | 3.3x |
| iPhone | Safari, iOS 18 | 100,000 | 20,000 | 3.7x |
| iPhone (2 runs) | Chrome, iOS 26 | 50,000-100,000 | 20,000 | 3.5-3.8x |
| Android phone, Mali-T760 class | Firefox | 10,000 | 5,000 | 1.6x |

In the raycaster scene (a first-person maze drawn as thousands of texture strips), spryte held 20,000 enemies against 5,000 on the RTX 4080 and in the RTX 5060 reference run, and 10,000 against 2,000 on the integrated laptop and the iPhones. [Run 2dbench on your device](https://debuffjp.github.io/2dbench/mobile.html) to add yours.

### Reading it fairly

- **Devices differ, ratios hold.** spryte's one-call-per-sprite path is ahead on every device so far. The bulk paths are 2.5-4x apart on desktop GPUs but finish level on iPhones, where the GPU's fill rate, not JavaScript, is the limit. Phone runs are one quick round each with coarse timers, so treat them as indicative.
- **Specialised against specialised, general against general.** `draw.sprites` and `ParticleContainer` are both bulk paths. `draw.sprite` and `Sprite` are the everyday ones. Both pairings are shown.
- **Same pixels, except rotated edges.** Coverage is 99.8-100% everywhere, and differences inside sprites are 0%. In the rotated scenes, 8.6-12.7% of drawn pixels differ, and all of them are edges: PixiJS's `roundPixels` snaps rotated corners and spryte doesn't. The inside-sprite check is validated: a deliberately wrong PixiJS tint raises it from 0% to 22%.
- **Every property really changes.** In the dynamic scenes, scale, tint, alpha and rotation all change over time, so no library can skip work by caching values that never change.
- **Older numbers aren't comparable.** On 2026-10-16 the same laptop measured every renderer faster. Only ratios from one session mean anything.
- **The Canvas 2D fallback** is only used where WebGL2 isn't available. It's about 20% slower than hand-written Canvas 2D (31.9 against 26.5 ms at 10k sprites), the cost of supporting tint and flash.

## Renderer: spryte against Phaser

Phaser 4.2.1 in the same harness, same laptop (RTX 5060, Chrome 155, AC power, 5 rounds), 50k sprites unless noted:

| Workload | spryte | Phaser 4 | spryte is |
| --- | --- | --- | --- |
| Bunnymark: `draw.sprite` against `Image` | **4.8 ms** | 15.0 ms | 3.1x faster |
| Mixed, 4 textures, everything changing | **7.4 ms** | 20.0 ms | 2.7x faster |
| Particles, one call per sprite | **6.9 ms** | 19.9 ms | 2.9x faster |
| Particles, bulk: `draw.sprites` against `SpriteGPULayer` | **1.9 ms** | 9.5 ms | 5.0x faster |
| Raycaster, 10k enemies | **10.1 ms** | 22.3 ms | 2.2x faster |

Phaser `Image` beat PixiJS `Sprite` in mixed and particles. `SpriteGPULayer` is built for members that rarely change, so a scene where every particle moves uses it against its design; it's Phaser's only bulk path with per-sprite rotation, scale and tint. The write-up, with method and caveats: [spryte vs Phaser](/blog/spryte-vs-phaser). Moving over: [Migrating from Phaser](/spryte/migrating-from-phaser).

## Reproduce it

The benchmark lives in the debuff repository ([`bench/renderer`](https://github.com/debuffjp/debuff/tree/main/bench/renderer)) and runs headless in your installed Chrome or Edge:

```bash
git clone https://github.com/debuffjp/debuff
cd debuff
npm install
npm run build
npm run bench:renderer                 # bunnymark
npm run bench:renderer -- mixed        # or: particles
```

Results are written to `bench/renderer/results/` with your GPU, browser, CPU and power state. `PARITY_DUMP=1` also saves the parity frames, so you can compare them yourself. Results from other devices are very welcome as pull requests, especially phones.

## Try it in your browser

The [plinko demo](/examples#plinko-sprite-stress-test) has a **stress test** button that keeps adding sprites while your device holds 60 fps, then shows the count it held.

## Size

spryte 0.7.2 on its own is **12.7 kB** of JavaScript at startup (11.3 kB in 0.3.0), against 87.8 kB for a PixiJS 8 app built the way its docs show (about 7x less) and 276.6 kB for Phaser 4.2.1, which can't be tree-shaken (brotli, Vite production builds of the same one-sprite scene; [harness](https://github.com/debuffjp/debuff/tree/main/bench/size)).

The starter game from `npm create debuff` builds to about **23 kB brotli**, everything included (runtime, input, audio, juice and the game). `debuff build` prints the raw, gzip and brotli size of every file, and fails if dev tooling leaks into the build.