Skip to content
All articles Optics and performance

Benchmark Liquid Glass Without Misreading the Metrics

Measure setup, map generation, and frame rendering as separate costs with a reproducible browser test.

Performance measurements for Liquid Glass answer different questions. Building or encoding a displacement map is setup work. Painting and compositing the filtered backdrop are frame costs. Measure both before choosing a quality tier for a production screen.

Capture an engine snapshot

After mounting the surfaces and letting the asynchronous maps settle, read the engine metrics. A React wrapper exposes the same readings through LiquidGlassRef.getMetrics().

import { LiquidGlassEngine } from 'quick-liquid';

const snapshot = LiquidGlassEngine.collectMetrics();
console.log(snapshot);

Use mapGenMs, mapEncodeMs, and mapPixelsComputed to describe map work. The aggregate snapshot's mapsGenerated and cacheHits are cumulative for the loaded module. Compare changes between two snapshots or use a fresh page for a clean run. A reused map can report the timing from its original generation. Engine frame counters describe engine work, while a browser Performance trace supplies compositor and rendering evidence.

Make the comparison repeatable

  1. Fix browser version, machine, viewport, device pixel ratio, and background. Record all five alongside the package version.
  2. Profile one surface and a representative group of surfaces. Do separate runs for equal-sized controls and controls of varied widths.
  3. Record startup separately from five seconds of the same scroll or backdrop movement. Include a forced css run with the same content.
  4. Repeat each case and report a median and a slow-frame percentile. Keep the trace or demo available so another person can reproduce the result.

Compare the lowest acceptable visual tier on both a development machine and a device at the lower end of your target audience. The repo's optimization notes explain the intended cost model. Use measurements from your own layout for performance claims.