Core Data vs Sqlite and performance

前端 未结 2 1975
臣服心动
臣服心动 2020-12-02 10:08

I am wondering if anyone has any real world numbers on performance differences between an old sqlite application which has been converted to Core Data in the 3.0 SDK.

相关标签:
2条回答
  • 2020-12-02 10:43

    Core Data is heavily optimized with regards to caching, lazy-loading and memory management.

    If you use it (with the SQLite store type), especially in conjunction with NSFetchedResultsController, you should get better performance than you could get with SQLite on your own.

    Apple has worked hard to make Core Data perform well on the iPhone. My application switched from SQLite w/ FMDB to Core Data and it is now faster and more stable with less code.

    0 讨论(0)
  • 2020-12-02 10:44

    Core Data can use sqllite - it is up to the developer to configure - so your suspect correctly. On the Phone I would suggest sqllite is the best idea.

    I think one of the biggest benefits you can gain by using Core Data is the lazy loading of data and the faulting to save on memory. So you need to also think about things like this when you are considering performance as the amount of free memory you have will also impact performance.

    0 讨论(0)
提交回复
热议问题