开发者

xml parsing is faster in C/C++ or Java? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this q开发者_运维百科uestion so that it can be reopened, visit the help center. Closed 11 years ago.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜