-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DropDownMenu] Preliminary step toward virtualization #3707
[DropDownMenu] Preliminary step toward virtualization #3707
Conversation
Looks like a nice improvement. :) I found myself wondering how much more time you could save if you got rid of the other child-cloning that's happening inside of the |
@callemall/material-ui This is a friendly ping :). |
@@ -367,17 +367,17 @@ const Menu = React.createClass({ | |||
this._setFocusIndex(focusIndex, false); | |||
|
|||
if (multiple) { | |||
const index = menuValue.indexOf(itemValue); | |||
const newMenuValue = index === -1 ? | |||
const index2 = menuValue.indexOf(itemValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late response 😅
I think itemIndex
is more readable.
All good aside from that 😅 |
[DropDownMenu] Preliminary step toward virtualization
@bvaughn Wow, that's a pretty nice time saving. Cloning element, as we can expected, is pretty expensive.
The API of this component used to be something close to a child-factory-function. |
Congrats on getting the first step merged! I'm looking forward to seeing what's next. :) |
This is a preliminary step toward adding support for react-virtualized and react-list.
We need to stop cloning children and doing heavy computation with them. cc @bvaughn.
Hopefully, that's already improving the performance of the rendering method (#2787).
Before : 446 ms to open the
Long example
After : 374 ms to open the
Long example