# 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:

slowest | fastest | not available

Library | Parsing small document | Adding new elemnt | Document creation | Writing tree | By-hand search | XPath search | Parse large document | Stream parsing | Pull parsing | SAX2 parsing | Lightweight parsing
--- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | ---
REXML 2.5.8 2003-10-10 | 580.2 | 17918.0 | 4775.8 | 8.8 | 7482.4 | 18.2 | 13.2 | 12.8 |  | 0.0 |
REXML @ANT_VERSION@ 2003-10-10 | 434.6 | 17809.2 | 4842.6 | 8.8 | 2713.6 | 41.0 | 1.4 | 1.6 | 1.0 | 0.0 | 1.6
REXML @ANT_VERSION@ 2003-10-10 | 445.2 | 17868.4 | 4835.6 | 8.6 | 2703.4 | 41.2 | 1.4 | 1.6 | 1.0 | 0.0 | 1.6
REXML @ANT_VERSION@ 2003-10-10 | 442.6 | 17857.0 | 4858.4 | 8.6 | 2683.0 | 39.6 | 1.4 | 1.6 | 1.0 | 1.6 | 1.4
REXML @ANT_VERSION@ 2003-10-30 | 434.4 | 17859.2 | 4777.6 | 7.4 | 2653.2 | 41.0 | 1.2 | 1.4 | 0.8 | 1.4 | 1.4
REXML 2.7.3 2004-02-09 | 426.6 | 17952.2 | 5373.2 | 84.6 | 2728.0 | 41.8 | 3.4 | 4.0 | 2.2 | 3.6 | 4.0
REXML 2.7.3 2004-02-09 | 431.2 | 17947.0 | 5447.6 | 84.4 | 2728.6 | 41.4 | 3.2 | 3.8 | 2.0 | 3.6 | 3.8
REXML @ANT_VERSION@ 2004-02-09 | 408.2 | 18565.8 | 5551.8 | 74.2 | 2752.0 | 41.4 | 10.6 | 15.0 | 12.4 | 11.4 | 17.2
REXML @ANT_VERSION@ 2004-02-10 | 357.2 | 17439.8 | 5199.6 | 75.4 | 2701.6 | 41.0 | 11.2 | 16.4 | 14.4 | 12.2 | 18.8
REXML @ANT_VERSION@ 2004-04-02 | 344.0 | 17135.2 | 4688.4 | 79.0 | 2437.2 | 38.2 | 10.0 | 13.6 | 12.6 | 10.6 | 16.4