[jdom-commits] CVS update: jdom/src/java/org/jdom/input
cvs at jools.org
cvs at jools.org
Sat Mar 2 05:31:54 PST 2002
Date: Saturday March 2, 2002 @ 8:31
Author: cvs
Update of /home/cvspublic/jdom/src/java/org/jdom/input
In directory jools.org:/tmp/cvs-serv32479
Modified Files:
SAXHandler.java
Log Message:
Changed some string comparators from != to !.equals(). The former works
so long as the parser interns strings, and although Xerces and Crimson do,
not all parsers do. So using !.equals() is safer. Brad Huffman ran some
tests to see if this had much of a performance impact, and surprisingly
it didn't and in fact sometimes ran *faster*. Below is his table, for
future reference.
This crosses off a long-standing TODO!
-jh-
Here's the minimum build times I got the other night comparing the interning
issue in SAXBuilder.
Running sosnoski's tests gave:
With Crimson
current intern change % of current
init.xml 158 161 +3 +2%
much_ado.xml 607 585 -22 -4%
periodic.xml 369 365 -4 -1%
soap1.xml 248 275 +27 +7%
soap2.xml 823 737 -86 -10%
test1.xml 18053 18548 +495 +3%
test2.xml 18056 17489 -567 -3%
test3.xml 633 628 -5 -0%
With Xerces-1.4.4
current intern change % of current
init.xml 165 167 +2 +1%
much_ado.xml 615 616 +1 +0%
periodic.xml 373 366 -7 -2%
soap1.xml 268 249 -19 -7%
soap2.xml 781 753 -28 -4%
test1.xml 18470 18232 -238 -1%
test2.xml 17666 17539 -127 -0%
test3.xml 641 642 +1 +0%
And wrapping CurrentTimeMillis around SAXBuilder.builder(filename) and
running it 10 times for each file gave:
With Crimson
current intern change % of current
init.xml 88 88 0 0%
much_ado.xml 599 608 +9 +1%
periodic.xml 361 361 0 0%
soap1.xml 18 19 +1 +5%
soap2.xml 749 787 +38 +5%
test1.xml 18254 19182 +928 +5%
test2.xml 17576 17819 +243 +2%
test3.xml 659 661 +2 +0%
The file I thought would do the worst is test2.xml, in it all prefix
are the as the local name except for the very last character.
===================================================================
File: no file SAXHandler.java Status: Needs Checkout
Working revision: 1.37 Sat Mar 2 13:31:53 2002
Repository revision: 1.37 /home/cvspublic/jdom/src/java/org/jdom/input/SAXHandler.java,v
Existing Tags:
jdom_prefilter (revision: 1.27)
jdom_1_0_b7 (revision: 1.18)
More information about the jdom-commits
mailing list