Skip to content

Android: reduce Java to .NET layout pass calls (alternative)#31776

Closed
albyrock87 wants to merge 2 commits intodotnet:net10.0from
albyrock87:reduce-layout-pass-java-to-dotnet-jni-calls-alternative
Closed

Android: reduce Java to .NET layout pass calls (alternative)#31776
albyrock87 wants to merge 2 commits intodotnet:net10.0from
albyrock87:reduce-layout-pass-java-to-dotnet-jni-calls-alternative

Conversation

@albyrock87
Copy link
Contributor

@albyrock87 albyrock87 commented Sep 25, 2025

Description of Change

This is an alternative for #31595 which aims to further reduce java interop.

Instead of preparing the measure for the actual Android.Views.View.Measure call, we invoke a custom measure method which eventually returns a special flag telling us whether a measure is needed.

If it is, we run the cross-platform-layout measure method and store the result by using an internal OverrideMeasuredDimension.

Benchmarks

Benchmarks are totally unreliable, I tried multiple times and I always get different results.

@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label Sep 25, 2025
@dotnet-policy-service
Copy link
Contributor

Hey there @@albyrock87! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed.

@albyrock87 albyrock87 force-pushed the reduce-layout-pass-java-to-dotnet-jni-calls-alternative branch from d0585b5 to ef1385d Compare September 25, 2025 14:45
@albyrock87 albyrock87 force-pushed the reduce-layout-pass-java-to-dotnet-jni-calls-alternative branch from ef1385d to cf81c7a Compare September 25, 2025 14:47
@jsuarezruiz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@jsuarezruiz jsuarezruiz added area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter perf/general The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf) labels Sep 29, 2025
Copy link
Contributor

@jsuarezruiz jsuarezruiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@albyrock87 Could you rebase to fix the conflict?

@albyrock87
Copy link
Contributor Author

I'll decline this because it doesn't show substantial performance increase, at least with my benchmarks.
I'll leave it here so that one could eventually start from here.

@albyrock87 albyrock87 closed this Nov 10, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Dec 11, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter community ✨ Community Contribution perf/general The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants