WhoBuilt

Boost Your Animations with Rive

May 2, 2024· 7 min· 3.2K views·Watch on YouTube

Speaker

Shripa, a software engineer at Kack, demonstrates how converting a Lottie animation to Rive affects performance in a React Native app.

Why animation performance matters

Shripa introduces React Native Optimization Shorts and focuses on smooth animations. He says many animations can increase RAM and graphics memory use, with unexpected behavior on lower-end devices.

Profile the Lottie animation

Shripa uses Android Studio’s Profiler to inspect the app’s Native, JavaScript, and Graphics memory categories. The example animation is stored in a JSON file and is nearly 100 kilobytes.

Convert the animation to Rive

Shripa imports the Lottie animation into the Rive editor, creates an artboard, and checks that it plays correctly. He installs the Rive React Native package and places the animation in Android’s `android/app/src/main/res/raw` directory.

Compare the results

After rebuilding the app, Shripa compares its performance with Rive. He reports that the animation file is about 50 kilobytes smaller and RAM use falls from 420 to 255 megabytes. He also says the animation runs at 60 frames per second.

Further optimization resources

Shripa points viewers to Callstack’s free Ultimate Guide to React Native Optimization for more performance advice. He closes the episode by previewing FlashList as the next topic.

Takeaways

  • Profile memory and frame rate before and after changing an animation format.
  • For Android, place Rive animation files in `android/app/src/main/res/raw`.
  • In Shripa’s example, the Rive file was about 50 KB smaller than the Lottie file.
  • The reported RAM use fell from 420 MB to 255 MB after switching to Rive.
  • Check animation performance on lower-end devices, where memory pressure can affect playback.

Mentioned in this talk

Search inside this talk

What was claimed 5

Related talks

Boost Your Animations with Rive, Shripa · WhoBuilt