dotnet / dotnet/android

Investigate Java collection wrappers performance

Open
#8,858 2 comments 2 reactions 0 assignees View on GitHub
Area: Mono.Android Area: Performance enhancement
Dominant language
C#
Stars
2.1k
Forks
579
Avg merge
1d 21h
Merged PRs (30d)
257

Description

Investigate if any of the methods provided by our Java collection wrappers (`JavaList`, `JavaDictionary`, etc.) could be implemented more efficiently.

For example, [`JavaList`](https://github.com/xamarin/xamarin-android/blob/main/src/Mono.Android/Android.Runtime/JavaList.cs) implements `ToArray ()` by calling `java.util.List.get (int)` for each item in the `List`, resulting in a lot of marshalling overhead.

Could we instead call [`java.util.List.toArray ()`](https://developer.android.com/reference/java/util/List?hl=en#toArray()) to retrieve all of the items in one call?

Another possibility might be to add something like `ToImmutableList ()` to efficiently move a copy of the list to C# that no longer needs to be kept in sync with Java?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.