Skip to content

perf(glass): pause the lens while the page scrolls, with a setting to keep it - #541

Open
Zakkaus wants to merge 3 commits into
mainfrom
perf/lens-scroll-pause
Open

Zakkaus wants to merge 3 commits into
mainfrom
perf/lens-scroll-pause

Conversation

@Zakkaus

@Zakkaus Zakkaus commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

Liquid Glass drops frames whenever the page scrolls. Chromium redraws every lensed backdrop (cards, sidebar, bottom bar, floating panel) on the CPU each frame the page moves under it.

While the window scrolls, and for 150 ms after, src/ui/lens.ts marks the root with data-lens-paused, and the lens tokens fall back to the same blur and colour without the refraction. At rest the look is unchanged; the bent edge and rim return 150 ms after scrolling stops.

Measured in headless Chrome on an RTX 4080 SUPER with hardware compositing, 4 s of continuous scroll, median of 3:

Page Before After Clear (no lens)
Desktop activity 41.8 fps, 11.1 ms draw 60 fps, 0.30 ms 60 fps, 0.22 ms
Desktop connections 46.4 fps, 10.2 ms 60 fps, 0.17 ms 60 fps, 0.12 ms
Phone activity 60 fps, 3.0 ms 60 fps, 0.19 ms 60 fps, 0.15 ms

"Draw" is the renderer compositor's MainFrame.Draw time per frame. Removing only url(#doona-lens) restored the baseline; removing the leading blur changed nothing.

Not addressed here: at rest, live updates still redraw the lens, at about 4.8 ms a frame on the desktop activity page against 1.3 ms without it.

Settings > Appearance has a switch for the pause, on by default and shown only with Liquid Glass. Turned off, the root carries data-lens-steady and the lens keeps refracting while scrolling. The Glass rows (wallpaper, blur, this switch) now load lazily with the Glass palettes, which keeps the Settings route in budget: 67,133 bytes gzip against a 72,800 limit, down from 72,757.

Settings, zh-TW
Settings, en

The Activity startup budget rises from 341,850 to 342,050 bytes gzip: the setting adds 151 bytes to that path (the preference, its effect and two catalogue strings), and CI measured 341,883.

Chromium redraws every lensed backdrop on the CPU each frame the page moves under it: about 11 ms a frame on a desktop page of cards, enough to drop to 42 fps on an RTX 4080. While the page scrolls, and for 150 ms after, the root carries data-lens-paused and the lens tokens fall back to the same blur and colour without the refraction. Scrolling measures at 60 fps with 0.3 ms of compositor draw, the same as Clear.
Settings > Appearance gains a switch, on by default, for the scroll pause. Turned off, the root carries data-lens-steady and lens.ts no longer pauses the lens. The Glass rows (wallpaper, blur and this switch) now load with the Glass palettes only, which keeps the Settings route within its size budget: 72,866 bytes over a 72,800 limit inline, 67,133 lazy.
@Zakkaus Zakkaus changed the title perf(glass): pause the lens while the page scrolls perf(glass): pause the lens while the page scrolls, with a setting to keep it Oct 10, 2026
…ting

The setting adds 151 bytes gzip to the Activity startup path (the preference, its effect and two catalogue strings); CI measured 341883 against the 341850 limit.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant