Skip to content
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

[Performance] Layout node slots only on resize #526

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

huchenlei
Copy link
Member

@huchenlei huchenlei commented Feb 14, 2025

Perform slot layout only when node is resized.

@huchenlei
Copy link
Member Author

Recommend leaving this unless it's a perf bottleneck - it should only provied a tiny benefit. If it's larger, it'd probably be faster to fix that instead. Making this work across the board with e.g. size[0] += 10 would require some special handling.

Test is failure because the frontend domWidgets.computeSize is getting it's own size adjustment into the loop without properly trigger the resize. (Probably avoid infinite loop of onResize?).

Need to do that cleanup before we can do the move of slot layout.

Copy link
Contributor

@webfiltered webfiltered left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommend leaving this unless it's a perf bottleneck - it should only provied a tiny benefit. If it's larger, it'd probably be faster to fix that instead. Making this work across the board with e.g. size[0] += 10 would require some special handling.

@huchenlei
Copy link
Member Author

Recommend leaving this unless it's a perf bottleneck - it should only provied a tiny benefit. If it's larger, it'd probably be faster to fix that instead. Making this work across the board with e.g. size[0] += 10 would require some special handling.

I moved the check to monitor boundingRect change, which should detect all size change, and trigger re-layout only when size of node has changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants