Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Reduce redundant layout calculations #2938

Open
mhsmith opened this issue Nov 1, 2024 · 0 comments · May be fixed by #3063
Open

Reduce redundant layout calculations #2938

mhsmith opened this issue Nov 1, 2024 · 0 comments · May be fixed by #3063
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. And even on WinForms, excessive updates will make the UI look unstable, and probably reduce performance.

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 loop iteration.

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
@HalfWhitt HalfWhitt linked a pull request Dec 29, 2024 that will close this issue
4 tasks
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New features, or improvements to existing features.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant