Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-09-2010, 09:35 AM   #1 (permalink)
Developer and Student
 
Join Date: Jan 2010
Location: Netherlands, the
Posts: 2
Default Best way to load data into memory

Hi All,

I was wondering. What is the best way to load static data into memory? We're developing a star viewer for the iPhone. We currently load all star data into memory via XML parsing. And with approximately 10000 stars our application, launch time is well over 30 seconds. We would like to bring down the launch time significantly.

I already tried parsing the data with the XMLParser class from Alan Quatermain. ( StreamingXMLParser at master from AlanQuatermain's aqtoolkit - GitHub ). But unfortunately this only slowed things down.

If you know a way to load the data much faster I would love to hear it. Thanks in advance.

Last edited by Thijs@MoteOfLife; 01-09-2010 at 09:50 AM. Reason: Spelling changes
Thijs@MoteOfLife is offline   Reply With Quote
Old 01-09-2010, 11:33 AM   #2 (permalink)
Registered Member
 
Join Date: Nov 2009
Posts: 5
Default

I suggest XMLPerformance example of Apple in part of C library.

Best regards.

Parada
the_aof is offline   Reply With Quote
Old 01-09-2010, 12:38 PM   #3 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 3,858
Default

NSArray's initWithContentsOfFile might be faster, if you can reformat your data into an array of dictionaries and save it as a plist.

Otherwise, if you don't use all of data at once then a SQLite database is probably a better bet. There's no reason to load the whole set into memory if you don't need the whole set at once.
__________________

Free Games!
smasher is offline   Reply With Quote
Old 01-09-2010, 01:26 PM   #4 (permalink)
Developer and Student
 
Join Date: Jan 2010
Location: Netherlands, the
Posts: 2
Default

Quote:
Originally Posted by smasher View Post
NSArray's initWithContentsOfFile might be faster, if you can reformat your data into an array of dictionaries and save it as a plist.

Otherwise, if you don't use all of data at once then a SQLite database is probably a better bet. There's no reason to load the whole set into memory if you don't need the whole set at once.
Thanks for the suggestions. But I do need the whole data set at once.

I read somewhere that SQLite would be faster anyway, but it was explained a bit vague.
Thijs@MoteOfLife is offline   Reply With Quote
Reply

Bookmarks

Tags
fast, load data, xml

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 158,884
Threads: 89,229
Posts: 380,763
Top Poster: BrianSlick (7,129)
Welcome to our newest member, karlam963
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:14 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0