REXML Comparisons

Timing Comparison

This page contains information comparing REXML to other XML parsing technologies. Included are timing comparisons. Each benchmark was run for 5 seconds, which probably isn't enough to flatten out startup bumps and so on, but EXML in particular barfed at a 10 second benchmark when it ran out of memory.

The numbers under the column headers are the versions of the library being used. The version under the EXML column is the version of Java that the test was run under; I'm not aware of a way to get the EXML library version. The version of Ruby is ruby 1.6.8 (2002-12-24) [i686-linux-gnu] .

The test for hand-parsing and XPath are looking for the same elements in a large document (tutorial.xml). Therefore, if the XPath value is half of the hand-parsing value, then on average, XPath is half as fast (but much easier!) as hand parsing.

These values are in calls-per-second; higher is better. The numbers in parenthesis are multiples of the REXML score; more than one is faster than REXML, less than one is slower. N/A means 'Not Applicable', meaning the parser doesn't support that function. The scores are color coded; Java scores are not included in this, since it wouldn't be meaningful. In these tests, Java is (nearly) always faster than Ruby. The color coding is as follows:

slowestfastestnot available
LibraryParsing small documentAdding new elemntDocument creationWriting treeBy-hand searchXPath searchParse large documentStream parsingPull parsingSAX2 parsingLightweight parsing
REXML 2.5.8 2003-10-10580.217918.04775.88.87482.418.
REXML @ANT_VERSION@ 2003-10-10434.617809.24842.68.82713.641.
REXML @ANT_VERSION@ 2003-10-10445.217868.44835.68.62703.441.
REXML @ANT_VERSION@ 2003-10-10442.617857.04858.48.62683.
REXML @ANT_VERSION@ 2003-10-30434.417859.24777.67.42653.
REXML 2.7.3 2004-02-09426.617952.25373.284.62728.
REXML 2.7.3 2004-02-09431.217947.05447.684.42728.641.
REXML @ANT_VERSION@ 2004-02-09408.218565.85551.874.22752.041.410.615.012.411.417.2
REXML @ANT_VERSION@ 2004-02-10357.217439.85199.675.42701.641.011.216.414.412.218.8
REXML @ANT_VERSION@ 2004-04-02344.017135.24688.479.02437.