-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[TreeView] Improve performance by removing getNavigableChildrenIds
method
#12713
[TreeView] Improve performance by removing getNavigableChildrenIds
method
#12713
Conversation
: [itemBId, itemAId]; | ||
}; | ||
|
||
export const getNavigableItemsInRange = ( |
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.
I added an index lookup in #12213, I will extract it into a standalone PR
* Another way to put it is which item is shallower in a trémaux tree | ||
* https://en.wikipedia.org/wiki/Tr%C3%A9maux_tree | ||
*/ | ||
const findOrderInTremauxTree = ( |
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.
Pure copy / paste
ab612ae
to
aeaaf3d
Compare
Deploy preview: https://deploy-preview-12713--material-ui-x.netlify.app/ |
: [itemBId, itemAId]; | ||
}; | ||
|
||
export const getNavigableItemsInRange = ( |
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.
I added an index lookup in #12213, I will extract it into a standalone PR
getNavigableChildrenIds
methodgetNavigableChildrenIds
method
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.
LGTM. 👏
I didn't do a super thorough testing, but code and behavior seems to check out. 👌
This part of the Tree View is probably the most tested, which makes me quite confident, but yeah it's a non trivial changer 😬 |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Requires to review #12729 before because it is merged inside this one.
Extracted from #12703
Part of #10300
The
instance.getNavigableChildrenIds
was looping on all the items to check if they were navigable or not and it was used a lot.For exemple, sometime several times per item when generating a range of items.