ios - CPU usage dropping as UIScrollView gets larger? -
experiencing strange phenomenon. app built around vertical uiscrollview (i.e. "the feed") activity timeline facebook's. when user scrolls bottom, feed can load older items in blocks of 20.
the first 0-20 items (default load) scroll fast , continues scroll fast when items 20-40 added, performance degrades when items 40-60 added , app becomes unusable when 60-80 added.
what's extremely odd cpu usage during entire scenario:
- 20 feed items (default): cpu 65%
- 40 feed items: cpu 40%, thread 1 activity down 25% (eyeballing)
- 60 feed items: cpu 18%, thread 1 down 50% previous
- 80 feed items: cpu 7%, thread 1 down 50% previous again
this leading me believe lack of performance not size of scroll view else causing cpu disengage in strange way. you'd expect cpu utilization increase, not decrease.
i thought perhaps inadvertently adding new feed items not on main thread , somehow screwing up, that's not case.
any thoughts?
fyi (iphone 5 running ios8, app built ios 8 sdk, don't think experiencing when building ios 7 sdk running on ios 7. performance degraded, but, iirc, predictably uiscrollview size - attempt confirm).
update built , ran app both 7 sdk , 8 sdk on iphone 4s running ios 7.0.6. not showing same issue. scrollview performance degrades more predictably , cpu usage not drop uiscrollview increases in size. bug in ios 8??
you should consider switching uitableview. designed avoid exact problem. when cells go off view, re-used cells being used. avoids allocating many of them. why contact list, ipod songs, facebook feed, etc don't degrade when table grows bigger.
Comments
Post a Comment