Performance issues on Raspberry Pi on X11 when navigating and using animations #20608
-
I've been trying to get to the bottom of an issue I'm facing with my application. It runs on a RPi 4, ARM64 on X11 and .NET9. The issue is when I navigate between pages in my application (using the Uno Navigator) I get very slow rendering on the page I'm navigating to, I can see parts of the screen being painted, the title, cards, icons, staggered. The strange thing is if I trigger the navigation externally (my device has a hardware button), instead of touching the screen, then it's butter smooth, no staggering effect. I have narrowed it down to the UI thread being congested when navigating and I believe it's because of the animations that are triggered when touching cards ( Could there be an issue where perhaps the animations aren't stopped when navigating away from a page (actually my page is the same, it's just the ViewModel that is changed = DataContext changed)? If I enable logging of animations then I can see the animations keep running even after my DataContext has been changed, and even if the animations may not be visible (since the VM is changed with new menu options), they seem to eat up resources in the UI thread so the rendering of the new page are very slow (takes up towards 1000mS instead of around 200mS when using my hardware button/no animations) and the user experience isn't as nice. In the attached logs I'll point out some important timestamps:
If I add a 2 second delay in triggering the navigation after the tap event then I don't have this issue, the animations are completed, then the navigation happens and there's no staggered rendering and it's all fast and smooth (just like hitting the hardware button). I also don't know if there's a way to "force" a higher priority to the rendering of/navigating to the new page over animations? Since it all has to happen on the UI thread it seems that congestion can happen, however I don't know if there are multiple events fired, or if there are a few longer running events that clogs it. On a fast Windows machine you don't notice this, but on a slower Raspberry Pi it becomes obvious. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 13 replies
-
Thanks for the report. At this time, animations are still run on the UI thread, and there's no available workaround to change this prioritization. One thing that you could try though, is to reduce the frame rate which is a 60 by default. This may be too high for a low powered device. In your |
Beta Was this translation helpful? Give feedback.
Thanks for the repro! Let's track in #20634