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

[Android] animation is really slow after upgrade to 0.76.2

Open nazacity opened this issue 1 year ago • 24 comments

Description

new arch enabled animation is really slow weird please see video below it looks like it take many cpu to run animation

https://github.com/user-attachments/assets/4a5bdece-6814-4837-99c9-2238a2697894

new arch disabled animation is working fine

https://github.com/user-attachments/assets/f0284a20-f487-4c96-b16c-1fa8e8fe3b24

Steps to reproduce

Snack or a link to a repository

Reanimated version

3.16.1

React Native version

0.76.2

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Fabric (New Architecture)

Build type

Debug app & dev bundle

Device

Android emulator

Device model

No response

Acknowledgements

Yes

nazacity avatar Nov 15 '24 23:11 nazacity

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Steps to reproduce and Snack or a link to a repository sections.

github-actions[bot] avatar Nov 15 '24 23:11 github-actions[bot]

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

github-actions[bot] avatar Nov 15 '24 23:11 github-actions[bot]

it seems that rendering/setState will affect the animation, so when the animation starts you need to avoid setState or change props. (it happens only under New Architecture)

doublelam avatar Nov 20 '24 07:11 doublelam

it seems that rendering/setState will affect the animation, so when the animation starts you need to avoid setState or change props. (it happens only under New Architecture)

Will it be fixed

nazacity avatar Nov 20 '24 10:11 nazacity

Hi @nazacity, I'm afraid that without a minimal reproduction we can't investigate that. Please provide one.

tjzel avatar Nov 20 '24 12:11 tjzel

Hi @nazacity, I'm afraid that without a minimal reproduction we can't investigate that. Please provide one.

I'll try to create reproduction one

nazacity avatar Nov 20 '24 12:11 nazacity

Will u create a reproduction, because it is a Serious problem, if you can't or u don't going, tell me I will reproduce it be cause it happens to me, for my case: fps in the old arch in the worst case gets 54 , in the new arch i could push it the 3 fps, (same reanimated implementation)

mimo-10 avatar Dec 07 '24 03:12 mimo-10

Will u create a reproduction, because it is a Serious problem, if you can't or u don't going, tell me I will reproduce it be cause it happens to me, for my case: fps in the old arch in the worst case gets 54 , in the new arch i could push it the 3 fps, (same reanimated implementation)

I'm trying but i'm still not abled to reproduce it. Could u please help

nazacity avatar Dec 08 '24 16:12 nazacity

Yes I will tomorrow morning, sorry I didn’t noticed that u responded. Beside that could I ask u, did u tried on iOS does it work normally their ¿ also you could send me a video with performance monitor on ? And thank u so much

mimo-10 avatar Dec 09 '24 21:12 mimo-10

Yes I will tomorrow morning, sorry I didn’t noticed that u responded. Beside that could I ask u, did u tried on iOS does it work normally their ¿ also you could send me a video with performance monitor on ? And thank u so much

updated to 3.17.0-rc.1 still not fixed

nazacity avatar Dec 28 '24 16:12 nazacity

I also confirm the 3.17.0-rc.1 is really better in my project !

freeboub avatar Dec 28 '24 18:12 freeboub

I can confirm, 3.17.0-rc.1 doesn't solve the performance degradation issue appeared after latest 0.76 upgrade.

pleerock avatar Jan 06 '25 14:01 pleerock

I have same problem in Android and iOS with de new Arch.

JeanSilvany avatar Jan 21 '25 22:01 JeanSilvany

anything new, performance is really bad

mimo-10 avatar Apr 25 '25 15:04 mimo-10

Hi @nazacity, I'm afraid that without a minimal reproduction we can't investigate that. Please provide one.

This problem is happing any all android phone, no need for reproduction, please fix this i been 3 month, we cannot go on production like this, also we cannot revert because any deps used is supporting only the new arch

mimo-10 avatar Apr 25 '25 15:04 mimo-10

Please upgrade to recent React Native version first.

If this doesn't help, provide a reproducible example so we can investigate it.

tomekzaw avatar Apr 28 '25 09:04 tomekzaw

which version version 0.78 ? or 0.79 ? if 0.78 i upgraded and it does not work, same issue, for the reproduction we dont need that because it happens on any animation, just put some animated element in one screen and u will notice it directly, apps is not usable at all like that, if u really need one i could try to produce and example, but as i told this issue is after the upgrade to 0.76 new arch thank u again

mimo-10 avatar Apr 28 '25 14:04 mimo-10

but please help, cuase is is a universel issue, it is effecting as a lot we have a deadline to finish the project and we are running out of time. anyway have a nice day

mimo-10 avatar Apr 28 '25 17:04 mimo-10

Also related #7460

genesiscz avatar Jun 04 '25 10:06 genesiscz

Please upgrade to recent React Native version first.

If this doesn't help, provide a reproducible example so we can investigate it.

Adding to this as there are several related issues open - I upgraded to 0.79.2 and enabled the new architecture on our codebase and I am seeing the same performance drops on iOS. Here is a simple component:

export const BlurredSurface: React.FC<SurfaceComponentProps> = ({ showNavBar: opacity }) => {
  const animatedStyle = useAnimatedStyle(() => ({ opacity: opacity.value }), []);
  return (
    <Animated.View style={[StyleSheet.absoluteFill, animatedStyle]}>
      <BlurView style={StyleSheet.absoluteFill} tint="dark" intensity={IS_ANDROID ? 100 : 50} />
    </Animated.View>
  );
};

This is a fairly trivial component but I am seeing major performance issues when the opacity changes. Here is a video of it with the animation:

https://github.com/user-attachments/assets/f270b505-6fb8-44be-9104-abb2607b4de8

And for this component (without the useAnimatedStyle hook and Animated.View):

export const BlurredSurface: React.FC<SurfaceComponentProps> = () => {
  return <BlurView style={StyleSheet.absoluteFill} tint="dark" intensity={IS_ANDROID ? 100 : 50} />;
};

I don't see any issues with performance:

https://github.com/user-attachments/assets/42eb2ff8-5ef3-4302-95b2-0531ce7c8fe6

Is this a known issue with the new architecture? It seems like a simple useAnimatedStyle hook with an opacity animation is causing major performance issues for me now. Here is the matrix of versions I have installed:

{
    ...
    "react-native": "0.79.2",
    "react-native-reanimated": "~3.17.4"
    ...
}

e-younan avatar Jun 05 '25 23:06 e-younan

I would like to highlight something that could help , in android the frame rate of the ui and us thread is synced meaning it is the same.

mimo-10 avatar Jun 06 '25 15:06 mimo-10

enabled new arch with react-native-reanimated, refresh rate significantly dropped

{
    ...
    "react-native": "0.76.9",
    "react-native-reanimated": "~3.17.5",
    "expo": "~52.0.46"
    ...
}

leungtinyau27m5 avatar Jun 09 '25 01:06 leungtinyau27m5

@e-younan can you maybe try instructions in https://github.com/software-mansion/react-native-reanimated/issues/7460#issuecomment-2939474567 where @tomekzaw kindly gave me a way to try to resolve that? Of course RNR should go to 4.0.0-betaXX

Maybe Tomek will have better chance here :-)

genesiscz avatar Jun 11 '25 17:06 genesiscz

Facing the same issue especially on a lower-mid range android phones

roo12312 avatar Jun 16 '25 08:06 roo12312

Hi, any update?

KolissnikBogdan avatar Jul 10 '25 12:07 KolissnikBogdan

FPS still drop in "react-native": "0.79.4"

duongdinh98 avatar Jul 28 '25 07:07 duongdinh98

Yes even with reanimated v4

mimo-10 avatar Jul 30 '25 20:07 mimo-10

Yes same issue react native 0.78 both ios and android

vorn-dev-ni avatar Jul 31 '25 13:07 vorn-dev-ni

I can confirm 0.79.5 also has this issue

mimo-10 avatar Jul 31 '25 14:07 mimo-10

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