I just wrote an
AQXMLParser test project, along with a Ruby script which
generated a 22MB XML file looking kinda like this:
…except with 200'000 items. I then record the amount of virtual memory used by
the app each time it parses a 'number' item, keeping track of the peak amount
allocated on top of the vm usage just before the parser launched (so measures only
the memory allocated from calling
[parser parse] and anything internal to that
routine). This means that even the 22MB for the XML data isn't included in the
Here's the output. I think it shows that AQXMLParser is going to be lovely for the iPhone. Mwa-ha-haa.
That's right, the
NSXMLParser variant (calling
xmlParseChunk() with all data
at once) uses 123-124MB, while
xmlParseChunk() with 1KB at
a time, not loading all data anywhere) gets 68KB.
In short: AQXMLParser == T3h w1n!
Code is on github now.