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

Reduce redundant layout calculations #2938

Open
mhsmith opened this issue Nov 1, 2024 · 0 comments
Open

Reduce redundant layout calculations #2938

mhsmith opened this issue Nov 1, 2024 · 0 comments
Labels
enhancement New features, or improvements to existing features.

Comments

@mhsmith
Copy link
Member

mhsmith commented Nov 1, 2024

What is the problem or limitation you are having?

Previous discussion:

Except for Winforms, none of the native platforms make any UI changes visible until the next main loop iteration, so we're doing a lot of redundant work.

This is particularly an issue with layout – if you insert N items into the layout, or you have N labels and you change the font or text on all of them, then we'll perform N layout passes, which will cost O(N ** 2) time.

Describe the solution you'd like

Delay layout updates until the end of the current main loopiteration.

This may also affect non-layout style properties if they're assigned multiple times within a single main loop iteration, where only the final value really matters. But that's likely to be less of a performance issue, so it might not be worth the effort.

@mhsmith mhsmith added the enhancement New features, or improvements to existing features. label Nov 1, 2024
@mhsmith mhsmith changed the title Reduce redundant layout and style updates Reduce redundant layout calculations Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features, or improvements to existing features.
Projects
None yet
Development

No branches or pull requests

1 participant