Quantcast
Channel: Appcelerator Developer Center Q&A Tag Feed (choppy)
Viewing all articles
Browse latest Browse all 9

TableView Performance / FPS Problems on iPhone

$
0
0

Hello,

I'm working with an app that requires TableViews with fancy layouts. Here's a quick capture of the layout:

http://s3.postimage.org/50ytpzgdb/asdf.png

You can see that in the most complex row ("Alexia, French Rolls ..."), we have 3 images, 4 labels, and a few Views to help with layout. We have about such 20 products in a typical list.

PROBLEM: When scrolling through the list, it's quite sluggish and choppy, with stuttering as you scroll. Inspecting the app performance via the XCode Instruments app shows FPS ranging from 9 - 25 on average on an iPhone 3GS/4G. iPad 2 is fast. Simulator is fast.

I have tried optimizing in a number of ways:

  • using "ClassName" on my TableViewRows

  • avoiding opacity, which is costly on performance.

  • avoiding borderRadius, which is costly on performance.

  • specifying static widths and heights.

  • avoiding "horizontal" layouts.

I'm using remote images (can't be helped).

Performance seems to have degraded between 1.5 and 1.6 as well.

In terms of workarounds, I have debated rendering my TableViewRows as images via toImage(), then adding the resulting ImageView to a scrollView instead of a TableView. This avoids TableViews altogether and gets a similar effect (without the other benefits of TableViews, like lazy-loaded images, contentInset search pulldowns, etc.). Problem was, when I tried this, the View rows were taking about 1 second/ea to draw at first, although FPS was about 50-60.

We even have one page with all images, then a 3-row TableView (same layout as above), and then more images below. Scrolling is fast until the TableView is shown, then it crawls while the TableView is on screen, and then is fast again once it's off-screen.

Any ideas on what we can do to improve performance? It's basically unusable for production use.

Thanks! Adam

(code samples available upon request, although it will be difficult to recreate the layout).


Viewing all articles
Browse latest Browse all 9

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>