funwithflutter / flutter_confetti

A Flutter widget that shoots confetti all over the screen.
https://pub.dev/packages/confetti
MIT License
439 stars 79 forks source link

Performance is low on Android #50

Closed penguru closed 1 year ago

penguru commented 3 years ago

In many Android phones I tested, animation is quite slow

funwithflutter commented 2 years ago

Hey @penguru, at least for the time being it may be slow on older devices. I have some ideas to improve the performance in the future.

cekrozl1 commented 2 years ago

Would you have any recommendations on how to optimise confetti animations? Something to add to the pages with confettis, or maybe something to avoid / remove?

https://user-images.githubusercontent.com/86661185/193251827-db79de15-b0a0-4527-9a32-191397280336.mov

cekrozl1 commented 2 years ago

Hi !

A quick update on the performance issue. It has been identified and likely related to the page transition widget.

The confettis have no performance issues after the page_transition is removed.

HayesGordon commented 1 year ago

Hi @cekrozl1 thanks for sharing. Yes unfortunately if there are other complex operations/animations happening, then it may result in dropped frames.

In the latest release there will be big performance enhancements: https://github.com/funwithflutter/flutter_confetti/pull/76

In this release it will be more performant and it will also try to limit the number of confetti being created if there are missed frames. See the changelog for details.

That said, it's always recommended to test animations on the lowest supported device.

HayesGordon commented 1 year ago

Something we could add in the future is an optimized performance mode, and then subsequently disable some of the effects. For example, rotations.