Speeding up creation of NSDictionary from XML? (iTunes related)
Speeding up creation of NSDictionary from XML? (iTunes related)
- Subject: Speeding up creation of NSDictionary from XML? (iTunes related)
- From: Jonathan del Strother <email@hidden>
- Date: Thu, 10 Nov 2005 18:08:05 +0000
My app reads the iTunes XML when it launches, and creates an
NSDictionary from it. This takes around 1.6 seconds for my iTunes
library.
I'd like to speed up the app launch time, so have been trying to
figure out ways of reducing this. I figured that if NSDictionary
didn't need to do the text parsing and validation procedures on the
XML, it would be far faster. So my original plan was to load the XML
as normal, then save the new NSDictionary in binary form. On next
launch, if the XML file date hasn't changed, we can just load the
binary form off disk, with no text parsing needed.
I originally tried this with NSKeyedUnarchiver, without much luck -
it was about 0.6 seconds *slower* than reading the xml.
NSUnarchiver did slightly better - 0.15 seconds faster than the xml.
Even so, I'd like it faster if at all possible. (The fact that
iTunes rather frequently bumps the file date on the XML doesn't help
matters, either)
Other than begging the CF team to optimise
CFPropertyListCreateFromXML some more, can anyone think of any other
techniques I might try on this?
Cheers
Jon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden