[XOM-interest] XOMTestCase.assertEquals() too slow

Elliotte Harold elharo at metalab.unc.edu
Fri Jan 26 13:47:35 EST 2007


Wolfgang Hoschek wrote:

> Turns out the comparison is implemented with an O(N^2) algorithm. It  
> stems from the (unnecessary) stateless nature of getNonTextNode 
> (expected, i) as used from XOMTestCase.compareChildren():

I've checked in a tentative fix for the problem. Please let me know if 
this works for you.

The compareChildren method has not been heavily optimized. Doubtless 
there are other ways to improve it if it's still a hot spot.


-- 
Elliotte Rusty Harold  elharo at metalab.unc.edu
Java I/O 2nd Edition Just Published!
http://www.cafeaulait.org/books/javaio2/
http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/



More information about the XOM-interest mailing list