Closed olivertylsar closed 2 weeks ago
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?
This smells like onLayout
events pollution, maybe measure
can come into play?
Hi @olivertylsar,
Could you please let me know if this PR works well for you?
This smells like
onLayout
events pollution, maybemeasure
can come into play?
@efstathiosntonas thank you for the insight.
The issues were mostly caused by lack of memoization, excessive JS-UI
synchronisations and SharedValues
having their value
props observed in the dependency arrays of useMemo
hooks.
I could be wrong, but as far as I know onLayout
had nothing to do with these issues.
Hi @latekvo,
I tried the FlashList example in the PR's branch and the results are much better now. The FPS still drops but only to something like 68 on average. I can only see a little of the blank spaces, the improvement is significant. Thanks for looking into it. 👍
Description
I noticed in my app that wrapping a render item in a Swipeable component (whether using the Legacy or Reanimated version) leads to a significant drop in FPS and a general decrease in the performance of FlashList/FlatList.
I tested this in your example code and was able to reproduce the issue.
https://github.com/user-attachments/assets/d4cd9724-8a02-474a-9b92-961cd8c6549f
https://github.com/user-attachments/assets/cca59a7b-edf7-41dd-bc94-97f7c170de07
Steps to reproduce
In the example app, install @shopify/flash-list (alternative code with FlatList is commented). Replace code in swipeableReanimation/index.tsx with code below and open the screen.
It happens only on Android for me, with both JS Debug mode on and off.
Snack or a link to a repository
https://snack.expo.io/
Gesture Handler version
2.20.0
React Native version
0.73.8
Platforms
Android
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Paper (Old Architecture)
Build type
Release mode
Device
Real device
Device model
Samsung S21
Acknowledgements
Yes