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

Improve measure invalidation and legacy Layout(s) performance #24551

Open
PureWeen opened this issue Aug 30, 2024 · 1 comment · May be fixed by #24532 or #24823
Open

Improve measure invalidation and legacy Layout(s) performance #24551

PureWeen opened this issue Aug 30, 2024 · 1 comment · May be fixed by #24532 or #24823
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter s/triaged Issue has been reviewed
Milestone

Comments

@PureWeen
Copy link
Member

TL;DR

  • Do not bubble up MeasureInvalidated on scrollable views and pages
  • Do not synchronously measure/arrange children on legacy layout upon child measure invalidated: simply wait for the next native layout pass

Description of Change

I executed a speedscope.zip on davidortinau/AllTheLists LearningPage using the latest 8.0.90-ci.net8.24430.1 build.

What I noticed is that #23052 OnChildMeasureInvalidatedInternal was showing up and taking 2% of total time (recursive calls).
image

This revealed an interesting thing, the time consumed in there is only due to legacy layouts (which includes ContentView) which are triggering synchronous native measurements instead of waiting for the layout pass which is optimized as it runs only once for each invalidated view.

image

Therefore I realized al that code is actually not needed and substantially wrong.

After these changes, the speedscope looks like this:
image

As you can see, legacy layout calls and page calls are gone, except for the TemplatedCell of the collection view which is still triggering synchronous measurements.

image

@PureWeen PureWeen added this to the .NET 8 SR9 milestone Aug 30, 2024
@dotnet-policy-service dotnet-policy-service bot added the s/triaged Issue has been reviewed label Aug 30, 2024
@PureWeen PureWeen added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Aug 30, 2024
@PureWeen PureWeen linked a pull request Aug 30, 2024 that will close this issue
@CleverSoftwarePoland
Copy link

Was there any problem or known issue why this update was not included in SR9?
Other improvements implemented in SR9 already gave some hope for better performance, but this one looks most promising.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter s/triaged Issue has been reviewed
Projects
Status: In Progress
2 participants