Xstream Driver Performance

I use XStream to convert XML to objects. I am converting large xml. I came across two statements.

XStream xstream = new XStream(new DomDriver()); XStream xstream = new XStream(new StaxDriver()); 

Since I use large xml for conversion, which result is better? why?

Please, help.

+6
source share
2 answers

Staxdriver should work better because it uses the pull parser technology, which is the fastest technology for parsing xml and uses less memory because the document does not load into memory, as for dom one.

+3
source

StaxDriver will analyze the data gradually so that it can be more efficient. It only works with Stax parsers. If you want to use the DOM parser, you need to use DomParser.

+2
source

Source: https://habr.com/ru/post/922581/


All Articles