Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Mono.Android] delay JNINativeWrapper.get_runtime_types() (#7913)
Reviewing `dotnet-trace` output, I noticed in a `dotnet new maui` app on a Pixel 5: 6.38ms mono.android!Android.Runtime.JNINativeWrapper.CreateDelegate(System.Delegate) 1.16ms mono.android!Android.Runtime.JNINativeWrapper.get_runtime_types() We spend ~1ms looking up `AndroidEnvironment.UnhandledException()` and `AndroidRuntimeInternal.WaitForBridgeProcessing()`. However, in this app *all* calls go to the "fast path" via `JNINativeWrapper.CreateBuiltInDelegate()`. We don't *need* to look up these methods in this app at all! Delay the call to `get_runtime_types()` to only when it is needed via the "slow path". Will help us a small amount in .NET 8.
- Loading branch information