Understanding View Count

#1

I’m creating my first app with RN, and I’ve noticed on certain screens performance is very different between Android and iOS. I have a particular screen that on every iOS device I test I get 60fps for UI & JS, but on Android my Galaxy S7 gets 7fps for both UI & JS.

I noticed that on iOS it shows the # of Views and I also noticed that as I’m navigating through different screen it seems that the view count never drops. New screens always just increase the view count, so by the time in the app the user gets to the above screen I mentioned, the view count is around 400-490. I guess I don’t understand the “createStackNavigator”, but once you navigate away from certain screens shouldn’t their resources be unloaded? I don’t know if this will help Android performance, as the iOS devices appear to be smooth sailing with the 400 view count, but I’m just trying to think of things I can do most of the time the user will be on this particular screen that gets 7fps. :cold_sweat:

#2

hey @dogofpavlov - is this 7fps on the js thread or the ui thread?

#3

Both.

I guess you could say that technically I’m doing something “intensive” (but by no means intensive for what you’d expect in a game)… inside a scroll view…Displaying 5 different “spritesheet animations” courtesy of this library https://github.com/MiLeung/rn-sprite-sheet.

But after taking a look at the library I really don’t think it’s doing anything too crazy, it’s simply altering the “top” & “left” values of an Image that is being cropped to show a particular sprite frame. I guess the thing that get’s me is why iOS runs it very smoothly.

Something I noticed is that in my scrollview, when I’m not “scrolled” to the animations (meaning they are out of view)… I see the FPS go back up to 60FPS, but as soon as I scroll the animations into view, the FPS drops to 7. The 5 SpriteSheet’s have pretty big images though (2235x2520). I had a thought for Android only to severely reduce the sizes of my images, but that’s kind of a last resort because the image quality of the sprites would suffer a lot as they are already pretty compressed. I guess the big question I have is why iOS is so much better at running this.

#4

can you share the source code? ios is better for a variety of reasons - single core performance, perhaps difference in the devices you’re testing on specifically, and other reasons potentially related to what you’re doing

#5

Sure! also thanks for the Help! I’ll share it once I get to my home computer (at work now). The performance was weird to me because testing on an old ipad from 2014 runs great, but not on a GalaxyS7 & S8 from last year. There must be something funky goin on.

#6

the libraries used for drawing images are completely different on ios and android and performance characteristics are as well

closed #7

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.