Skip to content

TypeManager.RegisterType() doesn't use type mappings #1831

@jonpryor

Description

@jonpryor

When recently profiling Xamarin.Android application startup, we observed that a callstack "rooted" in TypeManager.RegisterType() was using LINQ.

However, the real problem is that TypeManager.RegisterType() doesn't use our type mapping files!

https://github.com/xamarin/xamarin-android/blob/bb8183c8c16667b18ba9197e78294b17a0af532c/src/Mono.Android/Java.Interop/TypeManager.cs#L310-L326

It should at minimum be using JNIEnv.GetJniName(Type). Then, we need to make sure that monodroid_typemap_managed_to_java() is actually returning values, so that we don't hit the (slow, LINQ-using) JavaNativeTypeManager.ToJniName() fallback path.

VS bug #635223

Metadata

Metadata

Assignees

Labels

Area: App RuntimeIssues in `libmonodroid.so`.Area: PerformanceIssues with performance.vs-syncFor internal use only; creates a VSTS "mirror" issue.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions