views:

95

answers:

2

How do the memory utilization and performance for XML or SQLite compare on the iPhone?

The initial data set for our application is 500 records with no more than 750 characters each.

How well would XML compare with SQLite for accessing say record 397 without going through the first 396? I know SQLite3 would have a better methods for that, but how is the memory utilization?

A: 

To find out how the memory usage for your application fares, you need to measure your application :). The Instruments tool will help you.

Graham Lee
This doesn't really answer my question. I am looking for real experince and comparison.
Daniel A. White
It's not the answer you wanted but it's the only correct one.
Stephen Darlington
@Daniel: none of us has real experience with your application, nor can we compare the performance of your use cases. You can.
Graham Lee
+1  A: 

When dealing with XML, you'll probably need to read the entire file into memory to parse it, as well as write out the entire file when you want to save. With SQLite and Core Data, you can query the database to extract only certain records, and can write only the records that have been changed or added. Additionally, Core Data makes it easy to do batched fetching.

These limited reads and writes can make your application much faster if it is using SQLite or Core Data for its data store, particularly if you take advantage of Core Data's batched fetching. As Graham says, specific numbers on performance can only be obtained by testing under your specific circumstances, but in general XML is significantly slower for all but the smallest data sets. Memory usage can also be much greater, due to the need to load and parse records you do not need at that instant.

Brad Larson