-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed as not planned
Labels
Area-CompilersResolution-By DesignThe behavior reported in the issue matches the current designThe behavior reported in the issue matches the current design
Milestone
Description
Version Used:
Happens in both:
- .NET 7.0.100-rc.1.22368.2 SDK
- .NET 7.0.100-preview.7.22370.3 SDK
Noticed this here: dotnet/android#7170
Steps to Reproduce:
- Build xamarin-android
- Observe the size of
Mono.Android.dll. This is a C# "binding" of every Android API.
34502656 Mono.Android.net7.rc1.dll
32999936 Mono.Android.xa.main.dll
When I rain monodis --typedef, I noticed a bunch of new types generated, such as:
[CompilerGenerated]
private static class <>O
{
public static _JniMarshal_PP_L <0>__n_Sink;
public static _JniMarshal_PP_L <1>__n_Source;
}I tried to use ILSpy to understand how these are used:
private static Delegate GetSinkHandler()
{
if ((object)cb_sink == null)
{
cb_sink = JNINativeWrapper.CreateDelegate(new _JniMarshal_PP_L(n_Sink));
}
return cb_sink;
}In this case, the above method is called once and would only allocate a _JniMarshal_PP_L once. Are we paying extra file size for something that will only be called once?
Is there some flag to turn off this feature? (at least for this assembly) Thanks!
Here is before & after, and the monodis output: Mono.Android.zip
Expected Behavior:
Updating the .NET SDK, shouldn't increase the size of Mono.Android.dll noticeably.
Actual Behavior:
Updating the .NET SDK, increases the size of Mono.Android.dll.
Metadata
Metadata
Assignees
Labels
Area-CompilersResolution-By DesignThe behavior reported in the issue matches the current designThe behavior reported in the issue matches the current design