Feature Library

Performance and visual gates for any app

0.03 CPU ms
A still of the Performance and visual gates for any app demo
Still
The live demo starts when it’s in view.Run the gate: four bugs fail it · switch each bug off, run again until it passes · pick a row for its frames, or the shots for where they differ

A gate an app copies, with no packages: one Node script opens the app in headless Chrome on a fresh profile at an exact viewport and fails the run when a budget breaks.

What it costs a frame

0.03 ms
GPU
not used
CPU, median
0.03 ms
CPU, 95th pct
0.04 ms
Draw calls
0
Weight
Light

Measured 13 November 2026 on RTX 4060 Laptop, 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 157, 1920×1080 at 1×. 600 frames × 3 rounds, median kept (rounds ranged CPU 0.03–0.03 ms). What ran: Measured exercising itself with every bug fixed: each frame moves the hover across the chart (the handler and one on-demand draw). Idle, the chart draws nothing; a gate run is not part of the bench. Phones: tiers are being measured next.

On every machine it was measured on
MachineGPU msCPU msCPU p95
RTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring toolnot timed0.030.04
apple · Apple A19 Proin a browser tab · 16 November 2026not timed0.020.02
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 2026not timed0.060.10

Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.

What it needs

Renders with
DOM and CSSPlain DOM and CSS: every current browser.
Your browser
Runs hereNo WebGPU needed
Depends on
NothingNo other packages

What it’s for

  1. Catching a first-use hitch before people do
  2. Proving an app draws nothing while nothing moves
  3. A frame budget per scenario, checked on every change
  4. Screenshots that fail the build when a style change moves something
  5. Comparing a run with the last one, on the same machine
  6. Perf checks in CI without a test framework

Pitfalls, in brief

  1. Measure the worst frames, not the average: a gate on the mean passes an app that stutters.
  2. Run with the frame rate uncapped (gate.mjs’s flags turn vsync and the frame limit off): capped, a 7 ms frame reads as 16.7 at 60 Hz and the p95 says nothing about what a frame costs.
  3. Give a fresh profile to every run: a browser that kept its shader cache from the last run hides exactly the first-use hitch the gate is there to find. --fresh also reloads the page before each first use.
  4. Count your own draws for the idle test (draws: [[app, 'draw']]), not every animation frame: a page has other loops (a framework’s, a library’s), and counting them fails a page that is resting. raf: true counts them all, when that is what you want.
  5. Set the viewport over DevTools and check each screenshot’s size: a window size alone drifts by a few pixels with the browser’s chrome and the display’s scale, and silently voids every comparison.
5 more in brief
  1. Take shots in a fixed state: no hover, no animation, one theme, fonts loaded.
  2. A slower CPU loop after the run than before means the machine got hot or changed power plan: don’t compare that run with the last one, run it again cooled.
  3. When a run misses its budget, fix it or argue about it; never raise the budget to match.
  4. Ship the probe only in builds the gate opens (a query string or a test build): it wraps the app’s calls and, with gpu: true, the GPU device’s methods.
  5. gate.mjs loads gate-core.ts and png.ts directly, which needs Node 22.18 or later (type stripping); keep those two files to erasable TypeScript (no enums or parameter properties) and import-free.
10 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

From SpaciousPro. Fully custom code.

Chrome DevTools Protocol: the gate drives Chrome with its Page, Runtime, Input and Emulation domains (no code taken)

PNG (Portable Network Graphics) Specification: the chunk layout, CRC-32 and the five row filters png.ts reads and writes (Paeth’s predictor among them)

mulberry32 (Tommy Ettinger): the seeded random generator behind the demo’s chart data, a public-domain snippet kept as it is (demo only, not in the module)

performanceperf gatehitchfirst useidlerender on demandp95frame budgetvisual regressionscreenshotsbaselinepngheadless chromedevtools protocolcinodeno dependencies

Near it in the frame