Skip to content

Reduce redundant layout calculations #2938

Open
@mhsmith

Description

@mhsmith

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew features, or improvements to existing features.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions