Performance
What loads
| File | gzip | When |
|---|---|---|
| Core | 44.6 KB | Always: engine, 27 CSS effects, navigation, autoplay, a11y, smart fit, component, data-*, JSON, styles |
| Layers | 8.8 KB | A slide contains data-in, or imageIn is set |
| WebGL | 7.9 KB | effect is a WebGL effect and the device can use it |
| Overlays | 4.4 KB | overlay is set |
| Particles | 3.8 KB | particles is set |
| Scroll depth / drive | 1.5 KB each | scrollDepth / scrollDrive |
The published files are obfuscated (names, strings and property names are encoded). That costs about 16 KB of the core and less than 0.1 ms per frame; nothing changes in the API.
At runtime
- Compositor only. Slides move with
transform,opacity,filterandclip-path. Nothing triggers layout while sliding. requestAnimationFrameruns only while something moves. An idle slider costs nothing.- Off screen = paused. Autoplay, WebGL, particles, layer loops and background videos stop when the slider leaves the viewport or the tab is hidden.
- One measurement per resize, batched with
ResizeObserverand a frame. - Textures are cached (8 per slider, least recently used evicted); the WebGL context is released on
destroy().
Core Web Vitals
- CLS: the height is computed before the first paint of the slides. For a hero above the fold, give the first image
width/heightattributes or setaspectso the space is reserved before the image loads. - LCP: load the first slide's image eagerly (
fetchpriority="high"); usedata-srcfor the others. - INP: input handlers do no layout work; the first visual response to a drag happens in the same frame.
Checklist
- Serve images at the size they are shown:
srcset+sizes="100vw"for full-width heroes. - Prefer one WebGL slider per page.
- Use
lazy(default) withpreload: 1.