-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 MauiFactory performance by avoiding reflection to get base classes #24775
Conversation
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Head branch was pushed to by a user without write access
c89a4e3
bb8e201
to
01281ff
Compare
01281ff
to
ffe3077
Compare
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
new WarningsPerCode | ||
{ | ||
Code = "IL2070", | ||
Messages = new List<string> | ||
{ | ||
"Microsoft.Maui.Hosting.Internal.MauiFactory.ServiceBaseTypesFactory(Type): 'this' argument does not satisfy 'DynamicallyAccessedMemberTypes.Interfaces' in call to 'System.Type.GetInterfaces()'. The parameter '#0' of method 'Microsoft.Maui.Hosting.Internal.MauiFactory.ServiceBaseTypesFactory(Type)' does not have matching annotations. The source value must declare at least the same requirements as those declared on the target location it is assigned to.", | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have 0 trimmer warnings going forward in the net9.0
branch. Should we target net9.0
for this change instead?
Ideally, no new trimmer warnings are introduced, and this might be some side-effect of not using .NET 9.
Declined this PR because it completely changed in |
Description of Change
A minor improvement to a piece of code executed on every
ToHandler
orToPlatform
.Speedscope Before
Speedscope After
Extra note
I had some code ready to cache the entire
Type
=>ServiceDescriptor(s)
and make this even faster, but it breaks a unit test which honestly I don't understand the purpose of:maui/src/Core/tests/UnitTests/Hosting/HostBuilderHandlerTests.cs
Lines 86 to 99 in 3de5be9