Airbnb Cal Stephens Dec 6, 2022

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

Critical Insight

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.

The article includes side-by-side performance comparisons showing exactly how the old vs. new rendering engines behave under stress.

About This Article

Problem

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.

Solution

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.

Impact

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.