Skip to content

[scroll area] Measure every mounting Scroll Area before writing to any - #6092

Closed
Janpot wants to merge 1 commit into
mui:masterfrom
Janpot:janpot/scroll-area-batch-measure
Closed

Janpot wants to merge 1 commit into
mui:masterfrom
Janpot:janpot/scroll-area-batch-measure

Conversation

@Janpot

@Janpot Janpot commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Each Scroll Area measured its viewport and wrote its thumb sizes and offsets in one go, so mounting many of them forced a synchronous layout per instance. The measurement now reads first and returns its writes; Scroll Areas measuring in the same task queue in one microtask that runs every read before any write.

The smoke comment below doesn't list it: its 60 one-line Scroll Areas lay out too cheaply for the forced layouts to show. Locally against master (99% intervals), the smoke case shows no change detected, and mounting 300 Scroll Areas with 20 lines of overflowing content each improves paint by only 0.1% to 3.3% (90.8 ms to 90.0 ms), with render unchanged.

Split out of #5974.

Also returns undefined explicitly when there is no viewport.
@Janpot Janpot added performance component: scroll area Changes related to the scroll area component. labels Oct 23, 2026
@pkg-pr-new

pkg-pr-new Bot commented Oct 23, 2026

Copy link
Copy Markdown

commit: 6bd980e

@code-infra-dashboard

code-infra-dashboard Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+204B(+0.04%) 🔺+92B(+0.05%)

Details of bundle changes

Performance

No regressions in 36 benchmarks · ran 4m 12s · details


Check out the code infra dashboard for more information about this PR.

@netlify

netlify Bot commented Oct 23, 2026

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit 6bd980e
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6adb75e85ef77eba476e9093
😎 Deploy Preview https://deploy-preview-6092--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@Janpot Janpot closed this Oct 24, 2026
@Janpot

Janpot commented Oct 24, 2026

Copy link
Copy Markdown
Member Author

not a significant perf improvement

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

Labels

component: scroll area Changes related to the scroll area component. performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant