I have done XML parsing before but never on a massive scale.
If I’m working with many documents similar to this format:
<?xml version="1.0" ?>
<items comment="something...">
<uid>6523453</uid>
<uid>94593453</uid>
</items>
What is the fastest way to parse these documents?
1) XML DOM
2) XML Serialize – Rehydrate to a .NET Object
3) Some other method
UPDATE
I forgot to mention that there would be approx 8000 uid elements on average.
Using
XmlReaderis definitely going to be the quickest method, though you’ll have to do all the parsing manually of course. It reads directly from the stream without caching anything, though it’s not too convenient to use compared to the DOM.Comparing the two you suggested: serialisation ought to be quicker than using the DOM since (I believe) it doesn’t cache the entire tree within memory – it also certainly has an easier to use interface, if you’re specifically aiming to perform serialisation.