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
Context: https://github.com/dotnet/android/blob/main/Documentation/guides/tracing.md#how-to-dotnet-trace-a-build
Making a XAML or small C# change in a .NET MAUI project and running an
incremental build, shows a reasonable amount of time spent in
`<GenerateJavaStubs />` -- even with a device attached.
If I attach `dotnet trace` to `dotnet build`, I can see time spent in:
117.08ms (2.20%) xamarin.android.build.tasks!Xamarin.Android.Tasks.LLVMIR.MemberInfoUtilities.GetNumberFormat(class System.Reflection.MemberInfo)
82.33ms (1.60%) xamarin.android.build.tasks!Xamarin.Android.Tasks.LLVMIR.MemberInfoUtilities.IsNativePointerToPreallocatedBuffer(class System.Reflection.MemberInfo,unsigned int64&)
29.30ms (0.56%) xamarin.android.build.tasks!Xamarin.Android.Tasks.LLVMIR.MemberInfoUtilities.UsesDataProvider(class System.Reflection.MemberInfo)
17.49ms (0.33%) xamarin.android.build.tasks!Xamarin.Android.Tasks.LLVMIR.MemberInfoUtilities.PointsToSymbol(class System.Reflection.MemberInfo,class System.String&)
15.03ms (0.29%) xamarin.android.build.tasks!Xamarin.Android.Tasks.LLVMIR.MemberInfoUtilities.IsNativePointer(class System.Reflection.MemberInfo)
3.59ms (0.07%) xamarin.android.build.tasks!Xamarin.Android.Tasks.LLVMIR.MemberInfoUtilities.IsInlineArray(class System.Reflection.Membe
Where all of this time is spent in `MemberInfoUtilities` doing
System.Reflection to lookup members such as:
[NativeAssembler (NumberFormat = LLVMIR.LlvmIrVariableNumberFormat.Hexadecimal)]
public uint mono_components_mask;
Introduce `LlvmIrTypeCache` to cache `NativePointerAttribute` or
`NativeAssemblerAttribute` values based on `MemberInfo`. This cache
will live the lifetime of a `LlvmIrComposer` instance, so future
builds will not persist the cache.
With these changes in place, I see a modest improvement in an
incremental build with a XAML change with an attached device (1 RID):
Before:
Task GenerateJavaStubs 1008ms
After:
Task GenerateJavaStubs 872ms
So, this probably improves things by about 100ms or so.
thrownewNotSupportedException($"Internal error: inline arrays of type {smi.MemberType} aren't supported at this point. Field {smi.Info.Name} in structure {structInstance.Info.Name}");
thrownewInvalidOperationException($"Field '{smi.Info.Name}' of structure '{si.Info.Name}' points to a symbol, but symbol name wasn't provided and there's no configured data context provider");
0 commit comments