Skip to content

perf(web): keep composer updates within the scroll frame - #1418

Merged
nixuuu merged 1 commit into
devfrom
perf/composer-scroll-frame-budget
Nov 28, 2026
Merged

nixuuu merged 1 commit into
devfrom
perf/composer-scroll-frame-budget

Conversation

@nixuuu

@nixuuu nixuuu commented Nov 28, 2026

Copy link
Copy Markdown
Member

Slow wheel input could leave the composer at its previous height for the first frame of each short tween. Updating the footer edge also invalidated inherited styles throughout the virtual feed. The composer now applies travel that fits in one 120 Hz frame on its first paint, and only the backdrop, scrollbar gutter fade and footer actions inherit the moving edge.

Fixes: #1414

Frame measurements

Sampled production builds in Electron 45.4.1 on Linux with a local gateway, a 14-turn thread, a 1200 × 820 viewport and software offscreen rendering. Counted offscreen paint deliveries, native scroll events and composer surface size changes independently. Each workload ran twice at each refresh setting with 3.5 s of measured movement per run after warm-up.

Setting and gesture Paints/s before Paints/s after Composer height changes/s before Composer height changes/s after
60 Hz, slow wheel 52.7–59.8 60.0 26.5–29.7 57.4–58.0
60 Hz, rapid reversals 59.8–60.1 59.5–60.1 58.8–60.0 59.3–59.8
120 Hz, slow wheel 83.5–92.3 110.7–111.7 45.8–49.7 103.5–107.2
120 Hz, rapid reversals 113.2–113.4 117.5 96.8–104.8 116.6–117.1

The continuous wheel delivered 104–108 scroll events/s at 120 Hz after the change. The 95th-percentile paint interval was 14.4–14.8 ms for slow input and 11.4–11.7 ms for reversals, with an isolated 64.5 ms gap. These runs measured software output on the worker. Physical display presentation was unavailable.

In separate matched slow-scroll traces at 120 Hz, the largest style update visited 14 elements, down from 1,035.

Other verification

  • Chromium at 1200 and 390 px checked slow scrolling, reversals, reduced motion, focus, draft retention, Jump to latest and its 8 px clearance. Checked both backdrop gradients, their bottom alignment and the scrollbar gutter width.
  • Production web build, web typecheck, targeted lint, formatting and diff checks passed locally. Repository-wide verification runs in CI.

@nixuuu
nixuuu enabled auto-merge (squash) November 28, 2026 09:37
@nixuuu
nixuuu merged commit d9f46b1 into dev Nov 28, 2026
24 checks passed
@nixuuu
nixuuu deleted the perf/composer-scroll-frame-budget branch November 28, 2026 09:43
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