You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Xamarin.Android.Build.Tasks] fast path for <CheckClientHandlerType/>
`dotnet trace` of a `dotnet new maui` project, I noticed this was
happening on *any* build:
65.94ms xamarin.android.build.tasks!Xamarin.Android.Tasks.CheckClientHandlerType.RunTask()
Checking outside of a profiler, a `.binlog` says:
CheckClientHandlerType = 55 ms
This was added in 311b41e, so it is only in main & .NET 8. Maybe when
we timed this before, it wasn't a MAUI app?
Looking at the stack trace, most of the time is spent loading
assemblies with Mono.Cecil.
Let's add a check at the beginning for the two most common values:
* .NET 6+: `Xamarin.Android.Net.AndroidMessageHandler`
* Classic: `Xamarin.Android.Net.AndroidClientHandler`
And we can return early in these cases.
After these changes, I get:
CheckClientHandlerType = 2 ms
This should save ~53ms on any build w/ common settings for
`$(AndroidHttpClientHandlerType)`.
0 commit comments