Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Core Data vs Sqlite and performance

Tags:

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.

I suspect that under the hood Core Data is just using sqlite anyways and that it add's a bit of overhead for the cost of convenience, but i thought i would ask anyways.

like image 622
Lounges Avatar asked Jun 25 '09 17:06

Lounges


People also ask

Why Core Data is faster than SQLite?

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.

What is the difference between Core Data and SQLite?

The short answer is simple. Core Data is a framework for managing an object graph. SQLite is a relational database. Continue reading if you are interested in the long answer.

Is Core Data based on SQLite?

Although Core Data supports SQLite as a store type, the store format—like those of the other native Core Data stores—is private. You cannot create a SQLite database using the native SQLite API and use it directly with Core Data, nor should you manipulate an existing Core Data SQLite store using native SQLite API.


1 Answers

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.

like image 134
Hunter Avatar answered Sep 24 '22 18:09

Hunter