Skip to content

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
import android.view.ViewGroup;

public abstract class PlatformContentViewGroup extends ViewGroup {
public abstract class PlatformContentViewGroup extends PlatformViewGroup {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rmarinho is this a change doable during .NET10 SRs cycle or should I prepare a PR to do this now?

I think this is feasible even later... PlatformViewGroup is a ViewGroup so I'm not causing any API change.

An all PlatformViewGroup members will be internal.

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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