r/appdev • u/AgreeableRush12 • 2d ago
Adding analytics to an RN app that already drops frames
Hah. So my React Native app already stutters on the long feed screen. The perf monitor shows the JS thread dropping frames when the list scrolls fast, and I've done the usual memo and FlatList tuning. Now I'm being asked to add analytics and maybe session replay on top of that....and I'm nervous!! Anything that hooks every tap or grabs snapshots of the screen sounds like more load on a JS thread that is already dropping frames. I've read that some SDKs batch everything and send it from the native side while others do their work in JS, and the docs don't really say which is which. I also don't know if turning replay on for only a sample of sessions keeps the cost down for everybody else. What are you all running in RN that didn't make your frame rate worse?
1
u/TawrilAmreece77 1d ago
standard analytics shouldn't touch your frame rate unless youre tracking scroll depth on every tick. session replay is a different beast though, id disable capture while the list is actively scrolling or pause it on that route completely until the feed performance is sorted
1
u/EnoughReference290 1d ago
I just tested mine in a branch with the perf monitor up and scrolled the long list with the SDK on and then off. JS fps barely moved for me but the UI thread dipped a little when it was grabbing screens. Idk about every SDK but if the docs say they batch and send from native thats a good sign. Sampling replay helps too from what I seen