react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

Perf issues on android with Expo sdk 53

Open pierrezimmermannbam opened this issue 7 months ago • 10 comments

Description

A simple looping animation (a transform applied to a view through useAnimatedStyle) is very costly in terms of CPU. I tested to perform such animation in a fresh expo sdk 53 app and measured performance using flashlight and a Huawei P40 lite. Bellow is the result I get. I tested both with expo go and a dev client and got similar results

Image

On the real application I'm currently working on basic animations can make our FPS drop to 45 and cause continuous high CPU usage. The issues we're experiencing happen as well in release mode.

Steps to reproduce

I made a repo with the expo app I used https://github.com/pierrezimmermannbam/reanimated-perf-issue Clone the repo, launch the app in expo go on an android device and measure using flashlight measure

Snack or a link to a repository

https://github.com/pierrezimmermannbam/reanimated-perf-issue

Reanimated version

3.17.4

React Native version

0.79.2

Platforms

Android

JavaScript runtime

Hermes

Workflow

Expo Go

Architecture

Fabric (New Architecture)

Build type

Debug app & dev bundle

Device

No response

Host machine

macOS

Device model

Huawei P40 lite

Acknowledgements

Yes

pierrezimmermannbam avatar May 05 '25 12:05 pierrezimmermannbam

Same. Laggy animations after upgrading to SDK 53 with just useAnimatedStyle, opacity, transform animations. New arch

"expo": 53.0.7
"react-native-reanimated": "^3.17.5",
"react-native": "^0.79.2",

nshelia avatar May 05 '25 13:05 nshelia

Thanks @pierrezimmermannbam and @nshelia for reporting this.

Do you think this is caused solely by Expo SDK 53 upgrade or rather by enabling the New Architecture.

Could you please check if the problem persists when you (temporarily) disable the new architecture?

tomekzaw avatar May 05 '25 15:05 tomekzaw

The issue is not strictly related to expo sdk 53, I have also experienced it on expo 52. I tried with new arch disabled, results are slightly better but still not great

Image

Here is what I get if I just remove the animated view from the screen

Image

If I render 6 times the animated view it is just slightly worse than with a single one

Image

With new arch enabled and 6 animated views rendered:

Image

With new arch and no animated view

Image

pierrezimmermannbam avatar May 06 '25 08:05 pierrezimmermannbam

I think this issue might also be related to #7435

Looking forward to this, having the same problems here in my app with nothing really fancy happening

riamon-v avatar May 09 '25 21:05 riamon-v

Yeah, I'm not sure where the problem is exactly (since I have been building a completely new app version over the last 2 years) but the performance is 10x worse now on Android and I'm not able to release because of this. iOS is fine as always.

Maybe also related to: https://github.com/software-mansion/react-native-reanimated/issues/7480

EDIT: I was able to improve the performance somewhat (was mostly related to FlashList v2 and Skia - using standard FlatList on old android devices now and using the new filter property on View and react-native-svg instead of some Skia canvas for similar features.). Still it's not as fast as the old version, especially my scrollHandler and animated header with reanimated.

marcel-happyfloat avatar May 10 '25 08:05 marcel-happyfloat

I cloned down @pierrezimmermannbam's repo and ran it on my Samsung S22.

Left = No AnimatedView, average CPU was under 10% Right = with AnimatedView, average CPU was over 70%

Flashlight results

I then ran it with 10 AnimatedViews, and CPU usage went up even more.

10x Flashlight results

jamonholmgren avatar May 12 '25 22:05 jamonholmgren

🤔

dule-vikki avatar May 22 '25 08:05 dule-vikki

I'm facing the same performance issue after upgrading the app to expo SDK53. I'm using Animation for stories and tab navigation in my app. If anyone knows the solution please help me.

m-asad-mumtaz avatar May 29 '25 17:05 m-asad-mumtaz

Same performance issue

florian-deroo avatar May 30 '25 15:05 florian-deroo

Also related #7460

genesiscz avatar Jun 04 '25 10:06 genesiscz

Chiming in here--updating to expo 53 and reanimated 2.17 while opting out of the new architecture made our android app basically unusable as we make heavy use of reanimated across our app. Something as simple as making an audio skip forward button 'spin' on press is causing a whole second lag. Definitely interested in these performance issues being fixed!

trentcowden avatar Jul 16 '25 18:07 trentcowden

any interpolate animations we have after upgrading to expo sdk 53 and enabling new arch now lag significantly. It is basically unusable. Both on IOS and Android

2Senn avatar Jul 17 '25 00:07 2Senn

We are also experiencing major performance issues on Android since Expo 53, even with react-native-reanimated V4. The impact is significant enough to prevent us from going into production with the new architecture.

  • "expo": "53.0.19",
  • "react-native-reanimated": "^4.0.0",

Opus26 avatar Jul 27 '25 18:07 Opus26

@Opus26 Could you please specify what exactly do you mean by "major performance issues"? The more general the problem description is, the less we can do to help you.

tomekzaw avatar Jul 27 '25 20:07 tomekzaw

Hi all, if you're experiencing performance regressions of animations after enabling the New Architecture, please make sure to check out this page we recently added in Reanimated docs:

tomekzaw avatar Oct 28 '25 11:10 tomekzaw