Question

I have a large XML file ( around 1mb ) . i want to ask that if i parse the XML with NSXMLParser or KissXML/TouchXML.

which will take less interim memroy ?? ( the memroy took during parsing ) .

Was it helpful?

Solution

Considering for a large XML document you're likely not going to want a DOM parser, that rules out KissXML and TouchXML. Look for a SAX parser instead.

Using libxml2 in SAX mode is slightly (very marginally) more memory efficient than NSXMLParser, but the latter has a friendlier API, so the minimal memory savings may not be worth it (I wouldn't consider it worth it to jump straight to raw libxml2).

If you are dead set on using a DOM parser, you're not going to be able to find anything to process your document anywhere near as memory efficient as a SAX parser. For that reason, I won't recommend any DOM parser.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top