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

Use a separate LtrbRect type for render calculations #15112

Merged
merged 1 commit into from
Mar 28, 2024

Conversation

kekekeks
Copy link
Member

@kekekeks kekekeks commented Mar 24, 2024

We are doing quite a lot of Union/Intersect/Intersects operations in the renderer and those operate with Left/Top/Right/Bottom properties.
Our Rect type doesn't store Right/Bottom and has Width/Height instead, so there are lots of conversions. Render frame went from 26.5ms to 25.0ms on a "lots of controls on a canvas" benchmark, so the perf gain is significant enough to justify having a separate type.

@kekekeks kekekeks force-pushed the feature/perf-2024-03-0005 branch from 99fe3f2 to 2d4825f Compare March 28, 2024 16:49
@kekekeks kekekeks changed the title [DRAFT] Use a separate NormalizedRect type for rendering Use a separate LtrbRect type for render calculations Mar 28, 2024
@kekekeks kekekeks marked this pull request as ready for review March 28, 2024 16:50
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.2.999-cibuild0046754-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 added this pull request to the merge queue Mar 28, 2024
@maxkatz6 maxkatz6 removed this pull request from the merge queue due to a manual request Mar 28, 2024
@maxkatz6 maxkatz6 merged commit 5b59f6c into master Mar 28, 2024
11 checks passed
@maxkatz6 maxkatz6 deleted the feature/perf-2024-03-0005 branch March 28, 2024 22:08
@maxkatz6 maxkatz6 added the backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch label Apr 23, 2024
@maxkatz6 maxkatz6 added backported-11.1.x and removed backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch labels Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants