Closed mennahmostafa closed 1 year ago
There seems to be an issue in Core Animation itself causing this animation to render with poor performance.
When I test the animation I see the main thread itself has low CPU usage (e.g. 0% when playing the animation), but the app's render performance is poor / laggy. The render performance is also sluggish when using the Main Thread rendering engine, but not quite as bad. This suggests there's an issue in the Core Animation render server causing this performance problem, and probably not something we can fix in Lottie.
Since there's a decent workaround (use the Main Thread rendering engine) that mitigates some of the performance issues, I'm going to close this issue for now. It seems like an Apple framework issue that we wouldn't be able to work around in the Lottie library.
Alright, thanks @calda! Hope this helps others.
When using the attached animation file with Lottie V4.x using the default configuration (as in the below code snippet), the app freezes and the main thread does not respond to any events.
But when specifying the engine as MainThread (as in the below code snippet), the app doesn't freeze:
Note: this issue was not present before we upgraded to Lottie4.x
Which Version of Lottie are you using?
Lottie 4.1.3
Expected Behavior
Displaying the animation using the CoreAnimation rendering engine should not block the main thread.
Actual Behavior
Displaying the animation using the CoreAnimation rendering engine blocks the main thread.
Animation JSON
Wave.json.txt