Skip to content

[internal] Guess composite item indexes from render order - #6094

Draft
Janpot wants to merge 1 commit into
mui:masterfrom
Janpot:janpot/composite-guess-index
Draft

Janpot wants to merge 1 commit into
mui:masterfrom
Janpot:janpot/composite-guess-index

Conversation

@Janpot

@Janpot Janpot commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Composite items rendered through useCompositeItem (Tabs, Toolbar, Radio Group, toggle groups, Navigation Menu, and the menubar's Menu triggers) learned their index only after mount, so every item rendered twice. They now guess it from render order with useCompositeListItem's existing guess option, as Menu and Combobox items already do; a wrong guess, for grouped or out-of-order items, is corrected in the commit before paint.

The smoke comment below doesn't list it: no difference is confidently past its 10% band. Locally against master, the smoke cases of the components it touches (30 rounds, 99% intervals):

renders per mount render paint
RadioGroup 2 → 1 −15.4% to −9.9% −9.6% to −2.1%
ToggleGroup 2 → 1 −24.0% to −13.2% no change detected
Toolbar 2 → 2 −17.3% to −8.0% (nested update −69.1% to −50.3%, mount +0.0% to +9.0%) no change detected
Tabs, Menubar, NavigationMenu unchanged no change detected no change detected

Split out of #5974.

@Janpot Janpot added performance internal Behind-the-scenes enhancement. Formerly called “core”. component: composite labels Oct 23, 2026
@pkg-pr-new

pkg-pr-new Bot commented Oct 23, 2026

Copy link
Copy Markdown

commit: 241dbba

@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 🔺+14B(0.00%) 🔺+7B(0.00%)

Details of bundle changes

Performance

No regressions in 36 benchmarks · ran 3m 58s · 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 241dbba
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6adb7748f8dd31bd06e13f59
😎 Deploy Preview https://deploy-preview-6094--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.

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

component: composite internal Behind-the-scenes enhancement. Formerly called “core”. performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant