An 800 × 450 logical canvas at device pixel ratio three can have a 2,400 × 1,350 backing surface. That is 3.24 million pixels, nine times the original area. Confirm the monitor, browser and operating system are actually running at the target refresh rate.
Procedure
-
Fix viewport, pixel ratio, random seed and particle cap. Warm up and capture the same twenty-second input sequence. Record callback intervals, the longest one and the count over twice the target interval. A 144 Hz refresh lasts about 6.94 ms, some of which the browser needs for its own work.
-
Change one thing per run: disable drawing but retain update; freeze update and redraw a fixed scene; reduce backing resolution while retaining CSS dimensions. The first two separate simulation from draw submission. The third probes pixel cost. Timing draw calls with performance.now measures submission, not GPU completion.
-
If static paths dominate, prerender a tightly sized background and rebuild only on resize or theme change. Update text when its value changes. Before pooling particles, inspect allocation sampling for a matching hotspot.
Choosing an approach
| Experiment | If faster, investigate | Trade-off |
|---|---|---|
| Lower DPR | Fill and blending | Softer edges |
| Cache background | Repeated paths and text | Extra surface memory |
| Fewer particles | Updates and transparent overdraw | Less visual feedback |
Check the result
Repeat three times on the same device and power mode. Record median interval, P95, maximum and whether developer tools were open. If caching helps P95 but the worst frame persists, inspect other tasks during that frame. Without a 144 Hz display, report the actual refresh rate and measured work.
If fragments dominate allocation, replace them with a fixed-capacity particle pool.
Frequently asked questions
Is average FPS near 144 sufficient?
An average hides clusters of long frames. Read the interval distribution and test a burst of clicks.
Is an offscreen canvas always faster?
Rebuilding it every frame or copying a large sparse surface can outweigh the saving. Compare otherwise identical scenes.
References
Related reading
- A Canvas 2D particle pool with an allocation-free update loop for 144 Hz
- Fixed-step idle-game timing: equal production at 60 and 144 Hz