Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revoke #19349. Fixes #20684 #22566

Closed
wants to merge 1 commit into from
Closed

Revoke #19349. Fixes #20684 #22566

wants to merge 1 commit into from

Conversation

BaY1251
Copy link
Contributor

@BaY1251 BaY1251 commented May 22, 2024

This change comes from #19349, which simply and crudely piles up a large number of threads before loading the interface,Causing a significant decrease in performance. I don't have a better way, so I have to delete it

Description of Change

Revoke src\Core\AndroidNative\maui\src\main\java\com\microsoft\maui\PlatformInterop.java changed in #19349

Issues Fixed

Fixes #20684

This change comes from dotnet#19349, which simply and crudely piles up a large number of threads before loading the interface,Causing a significant decrease in performance.
I don't have a better way, so I have to delete it
@BaY1251 BaY1251 requested a review from a team as a code owner May 22, 2024 07:31
@dotnet-policy-service dotnet-policy-service bot added the community ✨ Community Contribution label May 22, 2024
Copy link
Contributor

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

@jsuarezruiz
Copy link
Contributor

/azp run

@jsuarezruiz jsuarezruiz added area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf) labels May 22, 2024
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@rmarinho rmarinho requested review from jonathanpeppers and mattleibow and removed request for StephaneDelcroix and tj-devel709 May 22, 2024 10:50
@PureWeen
Copy link
Member

@BaY1251 do you still see your original issue on the latest nightly build of MAUI?

Copy link
Member

@PureWeen PureWeen left a comment

Choose a reason for hiding this comment

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

I've seen this type of loop happen a few times from this code, but, in my experience this usually happens because of bad code further up the chain. For example, this PR #22347 that will be part of SR6 fixes an issue where updates to Frame cause a bunch of ping ponging.

Plus, we also have an issue with rounding on android currently.

I'd be curious to investigate why the loop is happening before we just revert this code.

@PureWeen
Copy link
Member

Closing this based on my findings here
#20684 (comment)

@PureWeen PureWeen closed this May 22, 2024
@BaY1251
Copy link
Contributor Author

BaY1251 commented May 23, 2024

@PureWeen I don't think my PR is a good solution, fortunately you have found a better way

@BaY1251
Copy link
Contributor Author

BaY1251 commented May 24, 2024

@PureWeen
PS:
#22347 is valid.

I'd be curious to investigate why the loop is happening before we just revert this code.

I am still searching for the root cause of the problem, it seems like it's not just a rounding problem.
I printed the log and saw that the height was constantly being changed to completely different values.
I'm not sure about this part of the code, could you please check it.

Code:
.\src\Core\src\Platform\Android\MauiScrollView.cs

log:
MauiScrollView.OnLayout: base.OnLayout(False,0,0,1920,936)
ViewExtensions.UpdateHeight: AutomationId:TopStackLayout,Height:936
ViewExtensions.UpdateHeight: AutomationId:GoToTestButton,Height:936
MauiScrollView.OnLayout: _hScrollView.Layout(False,0,0,1920,936)
ViewExtensions.UpdateHeight: AutomationId:TopStackLayout,Height:37
ViewExtensions.UpdateHeight: AutomationId:GoToTestButton,Height:37
MauiScrollView.OnLayout: base.OnLayout(False,0,0,1920,936)
ViewExtensions.UpdateHeight: AutomationId:TopStackLayout,Height:936
ViewExtensions.UpdateHeight: AutomationId:GoToTestButton,Height:936
MauiScrollView.OnLayout: _hScrollView.Layout(False,0,0,1920,936)
ViewExtensions.UpdateHeight: AutomationId:TopStackLayout,Height:37
ViewExtensions.UpdateHeight: AutomationId:GoToTestButton,Height:37

@BaY1251
Copy link
Contributor Author

BaY1251 commented May 24, 2024

_hScrollView.Layout(0, 0, hScrollViewWidth, hScrollViewHeight);

I just need to delete this line of code and the world will be clean, but I believe the problem is not that simple.

@BaY1251
Copy link
Contributor Author

BaY1251 commented May 24, 2024

@PureWeen Please check the PR #22628

@github-actions github-actions bot locked and limited conversation to collaborators Jun 24, 2024
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 t/perf 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.

[Android][MAUI-8.0.7] CPU usage consistently remains above 10%, even without any operation
3 participants