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

Performance problem when I load a Rive Animation in my flutter app #396

Closed
Ismaelito86 opened this issue Jun 12, 2024 · 2 comments
Closed
Labels
bug Something isn't working

Comments

@Ismaelito86
Copy link

I have a performance problem when I load a Rive Animation in my flutter app. I'm using last version of rive flutter package (0.13.7) and last version of flutter framework, I’m also using an iphone 15 pro device and when I load the animation, the cpu works at 80% and makes the device heat up, I'm already using skia as a rendering engine. This happens even without having any simple svg shape in the artboard (in the rive side), just having a timeline animation even empty is enough for get this behavior on the device. How can I fix this? Thanks a lot

@Ismaelito86 Ismaelito86 added the bug Something isn't working label Jun 12, 2024
@HayesGordon
Copy link
Contributor

Hi @Ismaelito86,

Some things you can try on your side:

  • Test on both Impeller and Skia to rule out if it’s a rendering bug
  • Test other Rive files to see if it isn’t isolated to the file you’re testing
  • Ensure you’re testing with a profile/release build

If you’re adding the animation to your app that has other logic/UI on screen, you might be causing Flutter to redraw all of that UI for each frame that Rive updates. You can wrap the Rive widget in a RepaintBoundary to ensure Rive doesn’t cause those other widgets to repaint.

It could be that there’s an issue with this animation file, and it’s in some strange condition that is causing the high usage—or, potentially, a bug with Skia in drawing those shapes/paths.

If you still have issues, please share an example project with us. A fresh project that has the animation, along with the code you’re using, so we can investigate the issue further.

@HayesGordon
Copy link
Contributor

Closing this issue as no additional information has been provided to reproduce the above results. We're also working on bringing the Rive Renderer to the Rive Flutter runtime, which should greatly enhance performance; see #388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants