[poc][autocomplete] Improve speed of opening the menu#48534
Draft
silviuaavram wants to merge 1 commit into
Draft
[poc][autocomplete] Improve speed of opening the menu#48534silviuaavram wants to merge 1 commit into
silviuaavram wants to merge 1 commit into
Conversation
Deploy previewhttps://deploy-preview-48534--material-ui.netlify.app/ Bundle size
Check out the code infra dashboard for more information about this PR. |
Member
|
Codex suggestion on the benchmark, it didn't even occur to me
|
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.
Some perf measurements and fix proposal, on Autocomplete open action.
To repro, click Autocomplete, then click outside (blur). The issue seems to be the double render, which increases the time the dropdown takes to open. Batching the state updates for open + pristine with focused avoids the double render. This issue is reported in Chrome, as a task that took too long. This is a non-production screenshot, production takes less.
The production version is more likely the one below. However, this is on a Macbook Pro, other devices might not be this fast.
The PR contains a test that calculates averages of the open action, and a tears down by clicking outside to close the menu. Running the test with and without the fix: