Skip to content

[illink] Try to avoid using SLE in JniRuntime/ManagedPeer #5400

@radekdoulik

Description

@radekdoulik

Possible savings, measured by not calling ManagedPeer.Init (), which leads to calling static ctor with registration of methods using SLE and that is pulling a lot of code/API in during linking:

Size difference in bytes ([*1] apk1 only, [*2] apk2 only):
  -          27 assemblies/Mono.Android.dll
  -          30 assemblies/System.Collections.Concurrent.dll
  -         989 assemblies/System.Linq.dll
  -       2,930 assemblies/Java.Interop.dll
  -       4,514 assemblies/System.Collections.dll *1
  -       4,874 assemblies/System.ObjectModel.dll *1
  -       7,987 assemblies/System.Private.CoreLib.dll
  -     115,284 assemblies/System.Linq.Expressions.dll *1
Summary:
  -     136,635 Assemblies -14.87% (of 918,689)
  -     139,506 Package size difference -1.79% (of 7,780,819)

I think we don't use com.xamarin.java_interop.ManagedPeer anywhere (yet?), so we hopefully don't need to register its methods.

I will look into that and either try to remove it or find out whether it would be at least possible to replace SLE usage.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions