Lottie 3.4.0 now available, with significant performance improvements thanks to a new rendering engine powered by Core Animation #1627
Replies: 7 comments 14 replies
-
Wow this is HUGE!! very very well done! |
Beta Was this translation helpful? Give feedback.
-
Great! when can we download it? I've tried updating it today but that version is not showing up on NPM yet, and when I try to download the package using the git target in my package.json it can only find 3.3.0. |
Beta Was this translation helpful? Give feedback.
-
Nice work! What features are supported with the Core Animation in this release? Thank you! |
Beta Was this translation helpful? Give feedback.
-
Greate job. |
Beta Was this translation helpful? Give feedback.
-
Awesome update! I've just added support for this new rendering engine on my LottieUI package and I'm seeing great usage reduction on the CPU. Great job! 👏 |
Beta Was this translation helpful? Give feedback.
-
Thank you very much for the hard work, always love to see work towards performance. My current animation is not rendering with CA and is falling back to main thread and I'm getting |
Beta Was this translation helpful? Give feedback.
-
Starting in today's Lottie 4.0 release, the new Core Animation rendering engine is now enabled by default for supported animations: #1832. You can learn more about the Lottie 4.0 release in this post on the Airbnb Tech Blog: Announcing Lottie 4.0 for iOS |
Beta Was this translation helpful? Give feedback.
-
Lottie
3.4.0
is now available! This release adds a new rendering engine that uses Core Animation instead of animating on the main thread. This significantly improves animation performance while also eliminating CPU overhead.Lottie’s original rendering engine played its animations on the app’s main thread. Once per frame, Lottie advanced the progress of the animation and re-rendered its content. This meant that:
Lottie
3.4.0
includes a new rendering engine that addresses these issues and significantly improves performance. The new engine leverages Core Animation to render out-of-process with GPU hardware acceleration. Once animations begin playing, they do not consume any of the app’s CPU resources, and are effectively guaranteed to animate smoothly regardless of CPU load:In Lottie
3.4.0
, the new Core Animation rendering engine is opt-in, configured by a feature flag (LottieConfiguration.renderingEngine
). In a future major version of Lottie, we plan on enabling the new rendering engine by default.Due to limitations of Core Animation, not all Lottie animation features are supported by the new rendering engine. Lottie includes a
RenderingEngineOption.automatic
option, which detects if an animation can be played correctly using the new rendering engine and otherwise falls back to the legacy main thread rendering engine. In most cases, enablingRenderingEngineOption.automatic
should not result in any user-facing behavior changes other than improved performance.You can enable the new Core Animation rendering engine globally in your app, by configuring the
LottieConfiguration.shared
singleton:or you can enable the new Core Animation rendering engine for an individual
AnimationView
:Please try out the new Core Animation rendering engine, and let us know how it goes!
If you enable
RenderingEngineOption.automatic
and find that your animation no longer renders correctly, please file an issue with your animation json. Ideally all animations will render correctly usingRenderingEngineOption.automatic
.In a future major version of Lottie we’d like to make this the default behavior, so nailing the automatic compatibility detection will be especially important.There are some advanced
AnimationView
features and methods that are currently not supported by the Core Animation rendering engine (such as some types of advanced value providers, and some operations that rely on animation key paths). If you actively use these methods and would like to adopt the Core Animation rendering engine, please file an issue with your use case. Pull requests are welcome as well (and much appreciated)! Feel free to reach out if you’d like tips on how to get started.3.4.0 includes several other new features and lots of bug fixes. You can find a full changelog here.
Beta Was this translation helpful? Give feedback.
All reactions