Mar 2008

Why is D/Tango so fast at parsing XML?

(9:05 am) Tags: [General, Projects, D Programming Language]

I have been getting questions concerning the performance of Tango in the XML benchmarks I have been running, with people wondering how something that is not C/C++ could be so fast. “They must be cheating!”

This post intends to explain how D, and subsequently Tango, can perform so well, even against C/C++. To read more about D, please visit the home page for D - D Programming Language. Tango is an alternate ’standard’ library for the D programming language, with a design philosophy of building a great library, with extensive documentation, and providing the greatest functionality in the most efficient manner possible. How do they do that you ask?

Comments are open if other D people would like to add their $.02.

Popularity: 100%

3 Responses to “Why is D/Tango so fast at parsing XML?”

  1. Artyom Shalkhakov Says:

    It’s very nice to see some real-world evidence that C++ can be beaten hands-down using smart library design.

    By the way, I see that Phobos’ std.xml performs poorly, but AFAIR it uses all the features you listed, being non-extractive parser.

    Thanks for the benchmarks, now I have another example to use in holywars :) (besides HXQ, an XQuery to Haskell compiler, and the like).


  2. anonymous Says:

    Why dont you compare tangoxml against netbsd dict, apache sax or libxml2? which are the most used ones and all of them are written in C instead of Java libraries?

  3. Scott Says:


    tests were done against libxml2, as you can see in the graph of the previous posts. When you say apache sax, which apache parsing project are you referring to?