Re: Efficient XML loading [continuation of NSString from mapped NSData thread]

2008-05-15 Thread Jens Alfke
On 15 May '08, at 1:36 AM, Jean-Daniel Dupas wrote: I'm using AE to query large info set from iTunes and don't get any performance issues. But you have to learn how to use AE. Agreed. (Disclosure: I worked on AppleScript 1.0 and 1.1, and on some of the underlying AppleEvent infrastructure.

Re: Efficient XML loading [continuation of NSString from mapped NSData thread]

2008-05-15 Thread Jean-Daniel Dupas
Le 15 mai 08 à 10:11, Matt Gough a écrit : On 15 May 2008, at 00:20, Jens Alfke wrote: Because it would be orders of magnitude slower. Even the property list parser can read the iTunes library in a few seconds. Extracting all that information via AppleEvents would certainly take minutes

Re: Efficient XML loading [continuation of NSString from mapped NSData thread]

2008-05-15 Thread Matt Gough
On 15 May 2008, at 00:20, Jens Alfke wrote: Because it would be orders of magnitude slower. Even the property list parser can read the iTunes library in a few seconds. Extracting all that information via AppleEvents would certainly take minutes. Taking that amount of time, it would be subjec

Re: Efficient XML loading [continuation of NSString from mapped NSData thread]

2008-05-14 Thread Jens Alfke
On 14 May '08, at 8:08 AM, Matt Gough wrote: Well, if iTunes is already running, why don't you just do it via Scripting Bridge? Because it would be orders of magnitude slower. Even the property list parser can read the iTunes library in a few seconds. Extracting all that information via

Re: Efficient XML loading [continuation of NSString from mapped NSData thread]

2008-05-14 Thread Louis Gerbarg
NSXMLParser needs to load everything into ram first, then it starts generating its stream of events. I recommend filing a bug asking for it to be enhanced to support incrementally available data. It will definitely be a dupe (I've filed it, among others I am sure)., but the more people who ask for

Re: Efficient XML loading [continuation of NSString from mapped NSData thread]

2008-05-14 Thread Keith Duncan
I was able to speed this up by an order of magnitude, by using libxml2 to parse the file (using the SAX API) into my own custom data structures. That's definitely good to know. Thanks for the pointer. Keith ___ Cocoa-dev mailing list (Cocoa-dev@li

Re: Efficient XML loading [continuation of NSString from mapped NSData thread]

2008-05-14 Thread Matt Gough
On 14 May 2008, at 16:52, Keith Duncan wrote: The only problem however is that iTunes periodically replaces this file, if this were to happen whilst I have the original mapped, would my app crash? Essentially, whilst I have the file open, will it remain readable? Well, if iTunes is alre

Re: Efficient XML loading [continuation of NSString from mapped NSData thread]

2008-05-14 Thread Jens Alfke
On 14 May '08, at 7:52 AM, Keith Duncan wrote: Currently I'm loading the iTunes XML library using -[NSDictionary initWithContentsOfFile:] but for my iTunes library, even a reasonably small one, the file weighs in at just over 4 MB. I ran into the same issue. The bottleneck isn't the file I

Efficient XML loading [continuation of NSString from mapped NSData thread]

2008-05-14 Thread Keith Duncan
Currently I'm loading the iTunes XML library using -[NSDictionary initWithContentsOfFile:] but for my iTunes library, even a reasonably small one, the file weighs in at just over 4 MB. This causes a noticeable pause in my application because it has to parse the entire file. I'm looking for