fix: react-combobox perf improvements#26191
Merged
smhigley merged 2 commits intomicrosoft:masterfrom Jan 6, 2023
Merged
Conversation
92c146e to
5a735cd
Compare
19 tasks
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 54b6220d442231ffa0c3df88359f53373690da6f (build) |
Collaborator
📊 Bundle size reportUnchanged fixtures
|
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 5a735cd:
|
Collaborator
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 1293 | 1295 | 5000 | |
| Button | mount | 835 | 829 | 5000 | |
| FluentProvider | mount | 1542 | 1544 | 5000 | |
| FluentProviderWithTheme | mount | 618 | 640 | 10 | |
| FluentProviderWithTheme | virtual-rerender | 525 | 522 | 10 | |
| FluentProviderWithTheme | virtual-rerender-with-unmount | 630 | 614 | 10 | |
| MakeStyles | mount | 1836 | 1780 | 50000 | |
| Persona | mount | 2721 | 2903 | 5000 | |
| SpinButton | mount | 2302 | 2482 | 5000 |
Collaborator
🕵 fluentuiv9 No visual regressions between this PR and main |
q1b
pushed a commit
to q1b/fluentui
that referenced
this pull request
Jan 24, 2023
- In useCombobox, popupWidth created a new object assigned to listbox.style every render. Now the object is created in the useState hook, and only updated when opened/closed. - In useTriggerListboxSlots, listbox event handlers every render. Now it uses useEventCallback, and should only update on open/close. - selectOption and setOpen were recreated every render, and since they are used in the combobox context, they caused options to re-render. Now they use useCallback.
Hotell
pushed a commit
to Hotell/fluentui
that referenced
this pull request
Feb 9, 2023
- In useCombobox, popupWidth created a new object assigned to listbox.style every render. Now the object is created in the useState hook, and only updated when opened/closed. - In useTriggerListboxSlots, listbox event handlers every render. Now it uses useEventCallback, and should only update on open/close. - selectOption and setOpen were recreated every render, and since they are used in the combobox context, they caused options to re-render. Now they use useCallback.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Addresses perf bullets from #26069
Changes
useCombobox,popupWidthcreated a new object assigned tolistbox.styleevery render. Now the object is created in theuseStatehook, and only updated when opened/closed.useTriggerListboxSlots, listbox event handlers every render. Now it usesuseEventCallback, and should only update on open/close.selectOptionandsetOpenwere recreated every render, and since they are used in the combobox context, they caused options to re-render. Now they useuseCallback.