I am using XStream to convert XML to objects. I am converting large xml. I have encountered below two statements.
XStream xstream = new XStream(new DomDriver());
XStream xstream = new XStream(new StaxDriver());
Since I am using large xml for conversion, which one result better performance? why?
Please help.
Staxdriver should perform better as it uses pull parser technology which is the fastest technology for parsing xml and uses less memory as document is not loaded in memory as for dom one.
The StaxDriver will parse the data progressively so it can be more efficient. It only work with Stax parsers. If you want to use a DOM parser, you need to use the DomParser.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With