开发者

Huge speed difference loading Core Data records on iPhone Simulator to iPhone 4

开发者 https://www.devze.com 2023-03-16 11:39 出处:网络
I\'m developing a data-driven application using Core Data. I display the tables from the SQLite database in a number of UITableViews. One of my tables has >15,000 records.

I'm developing a data-driven application using Core Data. I display the tables from the SQLite database in a number of UITableViews. One of my tables has >15,000 records.

When I load this table it takes <1 second (usually around the .933 开发者_JAVA百科mark) to load on screen. However when I deploy to an iPhone 4, the same table takes around 10 seconds to load.

It was at around 12 seconds, but I changed the fields I fetch, the number of records I fetch, and I've even dabbled in multi-threading, but that's all the time I can shave off.

I was thinking of setting the batch size to be fairly low on the fetch; however, my app makes use of indexing in the sectionIndexTitlesForTableView: and titleForHeaderInSection: methods, so I don't know how I'd accomplish it properly without giving a knock-on effect to these methods.

If anybody has any advice or tips for loading data into a table view, that would be fantastic.


You need to understand that your Simulator runs at your computer's CPU's power. I've read somewhere that the Simulator is usually 16x faster than the actual phone, so there will be discrepancies.

Have you considered doing infinite scrolling? Check TTTableFooterInfiniteScrollView from the Three20 project.

0

精彩评论

暂无评论...
验证码 换一张
取 消