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

Optimize converters for GridLength, ColumnDefinition, and RowDefinition #20048

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

symbiogenesis
Copy link
Contributor

@symbiogenesis symbiogenesis commented Jan 22, 2024

Some simple optimizations to these common converters.

I went ahead and set nullable types for the files, and added a benchmark.

There were already tests around these converters here and here.

Before:

Method Mean Error StdDev Gen0 Gen1 Allocated
ColumnConvertFrom 86.19 us 5.345 us 15.675 us 29.2969 0.2441 270.31 KB
ColumnConvertTo 30.46 us 0.445 us 0.395 us 4.5776 - 42.19 KB
RowConvertFrom 72.95 us 1.284 us 1.201 us 29.2969 0.2441 270.31 KB
RowConvertTo 30.67 us 0.278 us 0.260 us 4.5776 - 42.19 KB

After:

Method Mean Error StdDev Gen0 Gen1 Allocated
ColumnConvertFrom 59.00 us 1.160 us 3.157 us 25.7568 0.1221 236.72 KB
ColumnConvertTo 19.37 us 0.320 us 0.284 us 2.3804 - 21.88 KB
RowConvertFrom 58.12 us 1.113 us 1.093 us 25.7568 0.1831 236.72 KB
RowConvertTo 19.85 us 0.397 us 0.569 us 2.3804 - 21.88 KB

@symbiogenesis symbiogenesis requested a review from a team as a code owner January 22, 2024 02:15
@ghost ghost added the community ✨ Community Contribution label Jan 22, 2024
@ghost
Copy link

ghost commented Jan 22, 2024

Hey there @symbiogenesis! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@symbiogenesis symbiogenesis force-pushed the griddefinitionconverter-optimization branch 2 times, most recently from 3e5ac5e to 776086d Compare January 22, 2024 07:36
@symbiogenesis symbiogenesis force-pushed the griddefinitionconverter-optimization branch from 776086d to 48d4b8b Compare January 22, 2024 08:03
@samhouts samhouts added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Jan 25, 2024
@jsuarezruiz
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 3 pipeline(s).

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 community ✨ Community Contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants