Commit 6e9c3d7
authored
[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.1 parent 3d8a4ee commit 6e9c3d7
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | 37 | | |
40 | 38 | | |
41 | 39 | | |
| |||
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
| 46 | + | |
| 47 | + | |
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| |||
0 commit comments