Reputation: 153
The question is not related to comparison between different parsers, but it's related to the memory utilization and usage.
My question is that which method is better to read exactly one line "two elements" of an XML file, the XML parsers or Scanner method?
I will be running this script only once through 30 GB of XML files, so I thought of Scanner assuming it will be a faster method than xml parsing since I'm only reading certain lines from each object without manipulation or what so ever.
Upvotes: 1
Views: 218
Reputation: 8064
The speed is more than likely restricted by the speed of reading 30 GB of data, so either way of parsing will work. SAX is very efficient and can read XML's as a stream, so memory usage should be low.
Upvotes: 2