xml parsing is faster in C/C++ or Java? [closed]
I need to parse XML either in C/C++ or Java.
Which one is fast?
I think SAX parser will be ok with java
Pl. help
Generally C++ is compiled to native code while java is compiled to byte code and then is interpreted at runtime. Therefore C++ code should theoretically run fater.
But due to automatic memory management and other good features java development is much easier and faster. The big question is do you really ned some extraordinal performance requirements here? If not, implement everything in java. If you do have such requirements think about other options.
And BTW, why SAX? It is the hardest (and really fastest) whay to parse XML. Did you problably think about easier ways like JAXB? It requires 1% of efforts (relatively to SAX).
SAX parser is ok with Java.
But it is not connected to the Java/C++ performance comparison. SAX parsers are faster than DOM ones. But C++ and Java both have XML parsers for SAX and DOM.
精彩评论