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

Adds a rendering performance test #24762

Merged
merged 1 commit into from
Sep 21, 2024

Conversation

albyrock87
Copy link
Contributor

@albyrock87 albyrock87 commented Sep 13, 2024

Description of Change

This introduces a UI test to measure rendering performance.

Measurement happens by tracking IView.Frame mapping which happens right after the platform has arranged the view in the container view.

First pass
First time we generate 40 * 10 + 1 = 401 items.
This causes the creation of (40 * 5) + (40 * 10 * 4) + (1 * 5) + (1 * 4) = ~1800 platform views.

Second pass
Second time we generate 20 * 10 + 1 = 201 items.
This causes (20 * 5) + (20 * 10 * 4) = ~900 binding context changes and other ~900 platform views removals.

Third pass
Third time we manually clear the BindableContainer and reset the models to the initial state (1 measured item)

Notes
This enables us to measure the time it takes to:

  • Create platform views
  • Bind the new view models
  • Remove platform views
  • Clear platform views

Views include frequently used components like ContentView (legacy layout), Border, VerticalStackLayout, Grid, Label.

Output
Sample output visible in Azure test's attachments:

RenderingPerformance: [3035.6, 164.8, 57.6]

image

@albyrock87 albyrock87 force-pushed the adds-performance-test branch 8 times, most recently from 274481a to 9d3e259 Compare September 14, 2024 18:57
@jonathanpeppers
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@tj-devel709 tj-devel709 added area-testing Unit tests, device tests area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter labels Sep 16, 2024
@PureWeen
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@PureWeen
Copy link
Member

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@MartyIX
Copy link
Contributor

MartyIX commented Sep 20, 2024

Do I understand correctly that once this is merged, then every time CI runs we'll have in Azure test's attachments a file with performance data?

@albyrock87
Copy link
Contributor Author

@MartyIX that's correct, except for the windows platform where for some reason it doesn't show up on ADO.
It's probably an issue with the test runner, but that's out of my control.

@PureWeen PureWeen enabled auto-merge (squash) September 21, 2024 19:00
@PureWeen PureWeen merged commit 0e5e86a into dotnet:main Sep 21, 2024
97 checks passed
@albyrock87 albyrock87 deleted the adds-performance-test branch September 23, 2024 21:38
redducks100 pushed a commit to redducks100/maui that referenced this pull request Sep 24, 2024
@samhouts samhouts added fixed-in-net9.0-nightly This may be available in a nightly release! fixed-in-net8.0-nightly This may be available in a nightly release! labels Oct 1, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Nov 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter area-testing Unit tests, device tests community ✨ Community Contribution fixed-in-net8.0-nightly This may be available in a nightly release! fixed-in-net9.0-nightly This may be available in a nightly release!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants