Skip to content

MauiAppBuilderExtensions Benchmarks - DO NOT MERGE #4213

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

Closed
wants to merge 2 commits into from

Conversation

jamescrosswell
Copy link
Collaborator

@jamescrosswell jamescrosswell commented May 23, 2025

Not to be merged... this is just to investigate the performance implications of various different techniques for initialising the Sentry.Maui integration.

Third round of benchmarks, I realised much of what we wanted to measure was being hidden in the [GlobalSetup] for the Benchmark test. I moved all of this into the test itself (so that it would be properly measured)

Results of the latest benchmarks:

Method ResolveOptionsWithServiceProvider Mean Error StdDev Median Gen0 Gen1 Allocated
'Build MAUI App' Directly 494.3 us 19.62 us 53.38 us 476.0 us 12.6953 2.9297 105.13 KB
'Build MAUI App' ServiceProvider 488.1 us 8.56 us 12.55 us 486.6 us 15.6250 3.9063 129.52 KB
'Build MAUI App' InvokeConfigOptions 499.5 us 9.93 us 22.21 us 501.9 us 12.6953 3.9063 110.23 KB

This time round, the winner actually appears to be the existing code (as surprising as that may be).

Overall, the difference between all 3 solutions is less than 12 millionths of a second (running on a Macbook with an M2 processor). Even assuming we're running on a device that is 1000 times slower, that amounts to approximately ~10 ms.

Copy link
Contributor

github-actions bot commented May 23, 2025

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- MauiAppBuilderExtensions Benchmarks - DO NOT MERGE ([#4213](https://github.com/getsentry/sentry-dotnet/pull/4213))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 🚫 dangerJS against 7f64d50

@jamescrosswell
Copy link
Collaborator Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant