Skip to main content
Glassen shares a clock, sources and GPU resources within a surface. Performance depends on the pixel area covered, source work and overlap, as well as the number of lenses. Use one shared surface for collections. Reuse source and shape objects. Keep static source versions stable, and use GPU sources for continuously changing content. DOM snapshots are suitable for text and occasional updates, but repeated captures add CPU work and uploads.

Read the counters

These counters do not measure GPU completion or displayed frames. Browser/GPU caches and driver allocations are outside textureBytes.

Frame pacing

Surfaces stop issuing draws when their canvas leaves the viewport, including inside an embedded preview, and resume when it returns. Source activity follows the same visibility boundary. The renderer follows requestAnimationFrame and device pixel ratio, without adaptive resolution. A 120 Hz display gives about 8.3 ms per frame; 60 Hz gives about 16.7 ms. Large lenses, overlapping layers and expensive source rendering can exceed those budgets. No device-independent FPS or instance-count guarantee is made. Measure in a visible browser on the target device. Chrome’s frame-rendering stats and Performance trace distinguish presentation stalls, CPU work and GPU pressure. Test dragging, resize, multiple instances, background/resume and removal. A deterministic 4K60 recording proves the captured frame sequence; it does not prove real-time playback at 4K60.

Lifetime checks

Repeatedly mount and unmount the same scene. Owned textures and subscriptions should be released after consumers are removed; the WASM allocator may keep its grown memory for reuse. A memory plateau is different from growth on every cycle. Close GPU consumers before destroying their source or shape. Hidden/offscreen rendering pauses. A source can stop background work through setActive; it must account for every owner when shared. Avoid adding independent timers or render loops inside source adapters.