-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
[Tree] Improve Tree Performance by replacing computed height with TreeItem's cached minimum size #96841
[Tree] Improve Tree Performance by replacing computed height with TreeItem's cached minimum size #96841
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
8cc112d
to
437b4d2
Compare
437b4d2
to
b4ed6d0
Compare
This comment was marked as off-topic.
This comment was marked as off-topic.
e5e11b2
to
f5f813e
Compare
I see some discrepancy between the code you deleted in |
I'm wondering the reason that Also I noticed that Lines 1824 to 1827 in f5f813e
Lines 1523 to 1525 in f5f813e
|
f5f813e
to
bd51ae2
Compare
This PR is working fine in my project, what's causing it not to be merged yet? |
Only once call will be effective, unless the cell becomes dirty again for some reason. |
Thanks for pointing out! Lines 1542 to 1552 in f5f813e
As cached minimum size was used only for width calculation before this PR, I'm keeping the width combination here. |
bd51ae2
to
75c2b0b
Compare
There is some weird behavior when |
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.
Needs rebase.
79b994c
to
07b7af0
Compare
Thanks! |
Originally,
TreeItem
's content height was computed in every draw while traversing the tree, even if the item content never changes. And there's alreadyminimum_size
cached in each item, which is computed in a similar way.Tested on a massive plain-tree with 15K and 150K items(project file attached below), and got significant performance improvement (About 5~10x).
Here're results on my desktop when scrolling to near the bottom of tree.
I also checked the behaviors of more complex
Tree
s in the editor, and didn't notice any obvious artifacts, but I'm not very sure if there were any side-effect after changing these.Might partially fix these issues?
EDIT:
After some "extreme" test with huge amount of auto-wrapping text
TreeItems
and scrolling fast will cause some item's height cache being outdated.I'm still looking for some other way to make this work. So convert this to draft now and will try reopen when I figured out.I believe that's not related to this PR's modification, as I can reproduce the above issue in both 4.3 and master branch. I'll open another issue about that.
treetest.zip