Scott Sanders (stonecobra) has published some benchmarks for the shiny new Tango XML work that's been happening.  This is what happens when Kris gets involved in some optimization of code.  Sick, crazy-fast things start coming out.

For those of you who don't know, Tango is a standard library for the D Programming Language, and is an alternative to Phobos, the out-of-the-box standard library. 

I would love to see the other languages like C++ and Java put their best parsers up against this.  I think array slicing in D should soundly trounce them.

EDIT: Scott has fixed the graphs to show MB/sec as the metric.  I fixed some links in this post.

 


Comments

Robert Fraser

Sat, 23 Feb 2008 18:39:39

What's this measure in? Seconds? Looks to me like std.xml is 100+ times faster than Tango. Also, where are the files & what's the whole experimental methodology? Also, why is DOM faster than SAX?

 

Sat, 23 Feb 2008 18:50:26

Hi Robert,

Perhaps I should have posted the entire blog... http://dotnot.org/blog/index.php - sorry for the confusion. Longer bars are better, so SAX is faster than DOM and all is right w/ the world.

The 3-4 blog entries prior to the summary refer to MB/sec as the metric... At one point, this is offered up for Phobos: "Average checking speed: 1.68MB/sec. Can I get some help from phobos people? Scripting languages are faster than this…"

 

Sun, 24 Feb 2008 23:31:41

Nice tests. I don't use Java, but I wonder how <a href="http://woodstox.codehaus.org/">Woodstox</a> (StAX style parser, which is something like Tango's xmlpull), <a href="http://www.javolution.org/">Javolution's</a> <a href="http://www.javolution.org/api/javolution/xml/stream/XMLStreamReader.html">StAX implementation</a>, or even Tatu Saloranta's <a href="http://www.cowtowncoder.com/hatchery/aalto/index.html">Aalto XML Processor</a> (interesting because it is supposed to allow asynchronous parsing) would compare.

(Can't comment at Scott's blog)

 

Mon, 25 Feb 2008 08:05:18

Paul,

I would be happy to run a benchmark and publish the results if you could send me a program that simulates what is done in Sax.java, as listed on my blog. It is fairly easy to run the benchmark, just not having a lot of time to write new code. Currently working on a Java DOM benchmark.

Robert,
DOM is faster than SAX because of 2 things: 1) Kris wrote DOM and I wrote SAX, and 2) SAX makes a boatload more virtual calls.

 

Tue, 26 Feb 2008 21:33:43

I have written three tests for different Java parsers.. is there a way to contact you (Scott)?

I'm also writing a test for libxml's xml reader methods. I'm sure it will be faster than SAX.

 

Wed, 27 Feb 2008 21:48:51

Paul, I included and updated the graphs, check out my blog for the latest.

 



Leave a Reply

Name (required)
Email (not published)
Website