Announcing Lottie 4.0 for iOS
Article Summary
Airbnb just solved one of mobile animation's biggest performance problems. Lottie 4.0 eliminates the CPU overhead that was causing animations to drop frames and freeze.
Lottie is Airbnb's open source library for rendering vector animations, used in thousands of apps. Cal Stephens from the Airbnb team explains how they rebuilt the iOS rendering engine from the ground up.
Key Takeaways
- New Core Animation engine eliminates 5-20%+ CPU usage during animation playback
- Animations now run smoothly at 60-120 fps even when main thread is blocked
- Switching to new engine actually reduced Airbnb's app launch time
- Core Animation rendering engine now enabled by default in Lottie 4.0
- Bonus: 2x faster animation decoding and dotLottie file support
Lottie 4.0 moves animation rendering off the main thread to Core Animation, giving apps better performance while guaranteeing smooth animations regardless of CPU load.
About This Article
Lottie animations used 5-20%+ of CPU while running on the main thread. When the main thread got busy, animations wouldn't update, which caused frame drops and freezing on complex screens.
Cal Stephens and the Airbnb team rewrote the rendering engine with Core Animation. This creates CALayer objects with CAAnimation keyframes that the render server processes separately using GPU acceleration.
Animations now play smoothly at 60-120 fps even under heavy CPU load. Airbnb's app launch time actually got faster, and the startup animation's frame rate improved at the same time.