Sunday 3 March 2013

Handling Big XML Files on iPhone

Jim Dovey (aka @ alanQuatermain) has come up with what looks like a tremendous solution for handling very large XML files on the iPhone. Jim tested with a large (22 megabyte) XML file. Parsing the file with NSXMLDocument took about 123 megabytes of virtual memory to parse (I'm assuming this was run on the simulator since there's no way you could get that much heap allocated on the phone itself). 

Running the same exact file through his own parser used only 70 kilobytes of virtual memory. That's a dramatic, several-order-of-magnitude difference. So, if large XML files are the bane of your existence, you might want to check his solution out.

No comments:

Post a Comment