Chronos
A Canvas experiment rendering 100,000 continuously updating timers, with viewport-bound drawing instead of one DOM element per timer.
Chronos is an experiment in rendering a dense, continuously updating interface without creating a DOM element for every item. It puts 100,000 timers on a page and draws the visible timers onto a Canvas surface.
The collection remains data. The renderer uses the viewport and scroll position to determine which timers need to be drawn, rather than mounting, updating and removing an element for every timer. This keeps drawing work tied to the visible region instead of the total number of timers.
Rendering model
A normal DOM implementation gives every timer its own element. Virtual scrolling reduces that cost by keeping only the visible range and a buffer mounted. Canvas takes a different route: it draws the visible timers onto one shared surface, so there is no per-timer visual element in the DOM.
That shifts responsibility into the renderer. Chronos owns the drawing, positioning and update logic that the browser would otherwise provide for individual elements. It still needs to determine which timers intersect the viewport and render their current state.
Result
The Canvas implementation reached more than 115 FPS with 100,000 continuously updating timers. I also profiled the earlier virtual-scrolling implementation in Chrome DevTools to understand where its work was going.
Across the recorded intervals, the virtual-scrolling trace accumulated 5,003 ms of main-thread RunTask time. The two Canvas traces accumulated 1,039 ms and 689 ms. Layout accounted for 476.9 ms in the virtual-scrolling trace, compared with 55.5 ms and 49.3 ms in the Canvas traces. UpdateLayoutTree accounted for 766.4 ms, compared with 43.7 ms and 38.5 ms respectively.
| Chrome DevTools measurement | Virtual scrolling | Canvas trace 1 | Canvas trace 2 |
|---|---|---|---|
Main-thread RunTask duration |
5,003 ms | 1,039 ms | 689 ms |
| Layout duration | 476.9 ms | 55.5 ms | 49.3 ms |
UpdateLayoutTree duration |
766.4 ms | 43.7 ms | 38.5 ms |
| Paint duration | 646.1 ms | 115.6 ms | 103.4 ms |
These are cumulative event durations from the recordings, not mutually exclusive buckets; layout, style updates and paint are part of the broader rendering work, so their durations should not be added together. The recordings show a substantial reduction in main-thread work after moving the timer rendering to Canvas.
A plain DOM list of 100,000 continuously updating timers was not a viable baseline: the tab became unresponsive and the browser terminated it. Virtual scrolling was the practical DOM-based implementation to compare against. The useful comparison was therefore between a bounded set of DOM elements and a shared Canvas surface—not between Canvas and an intentionally unbounded DOM tree.
Chronos is the first experiment in a broader exploration of Canvas as a rendering model for dense interfaces.
Related writing
- Why Browser Benchmarks Lie When You Measure the Wrong Thing
Benchmark design across browser workloads: isolate the operation, include setup costs and understand what the measurement actually counts.
- Building Responsive Data Pipelines in the Browser
A look at worker ownership, typed storage, bounded work and viewport-driven queries across browser applications.
- When to Build a Primitive and When to Use a Library
A practical way to decide which parts of a system deserve custom engineering and which should rely on established browser or ecosystem primitives.
- Beyond the Comfort Zone: Pushing Canvas Beyond Games and Drawing
What changed when I used Canvas for dense interfaces, first with 100,000 timers and then with a large image collection, and where this rendering model makes sense.
- Accessibility for Interfaces Rendered on Canvas
Canvas can render dense interfaces efficiently while a bounded semantic DOM layer preserves keyboard and assistive-technology access.