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

iOS Rotate animation is very choppy due to LOTS of unneceesary measure cycles and makes application unusably slow #11891

Closed
philipag opened this issue Dec 6, 2022 · 3 comments
Labels
area-animation Animation, Transitions, Transforms area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/iOS 🍎 t/bug Something isn't working t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)
Milestone

Comments

@philipag
Copy link

philipag commented Dec 6, 2022

Description

In the sample attached below you can see that the robot image rotation is very choppy. This is particularly evident on an iOS simulator where things run a bit slower than a high end phone. On my test machine I am getting perhaps 5-10fps.

On Windows and Android this animation runs smoothly and Measure() and MeasureOverride() are not called on the animated control or other controls.

On iOS, Measure() and MeasureOverride() are called all the time. They are even called on neighboring controls (making the animation even slower). In the sample you can see they are called for the label even though the animation has nothing to do with the label.

This is a major regression from XF and prevents us from shipping an application ported to MAUI. In XF, animations did not cause all the unnecessary measure cycles and the animation also ran smoothly on iOS.

MauiApp4_rotatebug.zip

Steps to Reproduce

  1. run the sample using iOS simulator
  2. debug output shows all the Measure() calls to the rotated and other controls.
  3. the animation is slow and consumes a lot of CPU
  4. Under Windows+Android this does not happen and the animation is smooth and consumes little CPU.

Link to public reproduction project repository

see atttached sample

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

iOS 15,16

Did you find any workaround?

no

Relevant log output

No response

@philipag philipag added the t/bug Something isn't working label Dec 6, 2022
@philipag
Copy link
Author

philipag commented Dec 6, 2022

Just to be clear about the magnitude of this bug: this bug can essentially cause the entire visual tree to be re-measured for each step of the animation!

Update: This happens with Translate animations as well.

@hartez hartez added area-animation Animation, Transitions, Transforms area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter platform/iOS 🍎 labels Dec 6, 2022
@PureWeen PureWeen added this to the Backlog milestone Dec 6, 2022
@ghost
Copy link

ghost commented Dec 6, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@jsuarezruiz jsuarezruiz added the legacy-area-perf Startup / Runtime performance label Dec 7, 2022
@hartez hartez added s/try-latest-version Please try to reproduce the potential issue on the latest public version and removed s/try-latest-version Please try to reproduce the potential issue on the latest public version labels Mar 8, 2023
@dotnet dotnet deleted a comment Mar 8, 2023
@hartez
Copy link
Contributor

hartez commented Mar 8, 2023

Fixed by #12627. The fix is available in .NET 8 Preview 1; it has been backported to .NET 7 (#12933), and will be in the next service release.

@hartez hartez closed this as completed Mar 8, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Apr 7, 2023
@samhouts samhouts added the migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert label Aug 28, 2023
@Eilon Eilon added t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf) and removed legacy-area-perf Startup / Runtime performance labels May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-animation Animation, Transitions, Transforms area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter migration-compatibility Xamarin.Forms to .NET MAUI Migration, Upgrade Assistant, Try-Convert platform/iOS 🍎 t/bug Something isn't working t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)
Projects
None yet
Development

No branches or pull requests

6 participants