I have a multithreaded app that has a table view. It does data gathering in the background on a different thread. The problem is, when the user scrolls the table, the data gathering slows by a whopping 75%. And there’s a lot of data to gather, so I want to have table scrolling reduce data-gathering speed by no more than 15% if that’s possible.
Is there perhaps a way to make the TableView only redraw when the user takes their finger off the screen? Don’t worry about user experience, let me worry about that. If you have any ideas at all that could speed it up, I’d like to hear them.
Sounds like your bottleneck is the “data-gathering” in the background, so you might consider attacking that. You could try pre-fetching a lot of the data and caching it in memory before displaying your table view controller.
You could also try just redrawing part of the cell (for example, only the text and not any images) if it is particularly complicated. For the expensive operations you could do perform selector with a delay of 0, and that will throw it to the next iteration of the run loop (good strategy all around).
Best thing you could do thought is run Instruments with the Time Profiler and attack what’s sucking up the most CPU.