-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Height, margin and padding animations feel laggy and flickery on production (3.7.0) #5685
Comments
Same issue |
I'm experiencing lags after updating from 3.6.1 to 3.7.0 |
Hey @domenicoprestia @pavelbabenko @lcarrettin 👋 We can't investigate anything without reproducible code. Do you have any example with mentioned issue that I can easily run and observe problems? Also, I suggest checking on newest versions (3.12.0, 3.12.1) as well |
@szydlovsky animate any image with width and height in a useAnimatedStyle, you will notice flickering and lag |
I see the same lags in v3.6.1. I think the problem is that all animation calculations for height changes and paddings use the CPU, not the GPU. But I could be wrong |
@szydlovsky I've added a reproducer to the reanimated-padding-animation-issue branch here: https://github.com/mhoran/react-native-scratch/tree/reanimated-padding-animation-issue. This is using Reanimated 3.16.3 (also see on 3.17.0) and react-native 0.76.3. The issue gets more pronounced the more complicated the UI gets. The issue is not very pronounced in this reproducer, but you can still see it. On a real device with real content in a similar UI, the keyboard animation is extremely laggy when done using padding. The reproducer is set up to use padding by default. Changing the Screen recordings: |
On New Arch, even having a static value for padding (e.g. |
Hi @mhoran, @szydlovsky has moved to another project for the time being. Thanks for the repro and the recordings, they will be helpful. However, our hands are pretty full right now and I can't make any promises about the timeline this will be investigated. I'll forward the New Arch bit to @bartlomiejbloniarz since it might be some other underlying problem. If the issue is blocking someone, please try troubleshooting it yourself and report the results/make a PR to fix it - it's the best way to make sure this is tackled fast. Don't hesitate to ask us for help if you need directions in investigating. Just to leave a note here, animating margins and paddings can be very costly in terms of layout re-calculations. It might be the root of the lag here and the bottleneck could be something else than Reanimated in this case. |
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? |
The bot really is something else... |
Thanks @tjzel. Understood re: padding animations. I have found a way to use Re: New Arch, I was able to implement a workaround which minimizes the presence of |
Description
When animating Animated components on height/paddings and margins all animations feel laggy and flickery in production builds.
Steps to reproduce
Snack or a link to a repository
i cant link a repo
Reanimated version
3.7.0
React Native version
0.72.6
Platforms
Android, iOS
JavaScript runtime
Hermes
Workflow
None
Architecture
Paper (Old Architecture)
Build type
Release app & production bundle
Device
Real device
Device model
All devices
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: