Skip to Content.
Sympa Menu

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

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Wolfgang Hoschek <wolfgang.hoschek AT mac.com>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] XOMTestCase.assertEquals() too slow
  • Date: Thu, 25 Jan 2007 23:49:55 -0800


On Jan 25, 2007, at 9:44 PM, Wolfgang Hoschek wrote:

It's not clear why XOMTestCase.assertEquals() should be orders of
magnitude slower than parsing or serialization. All of these should
clearly be O(N) overall.

Turns out the comparison is implemented with an O(N^2) algorithm.

Since this is all code related to normalization I looked at how nux.xom.pool.XOMUtil.Normalizer behaves for wide trees (e.g. database dump style documents, indented). Turns out it's also O(N^2) in this case, but it was straightforward to change it to O(N).

Wolfgang.






Archive powered by MHonArc 2.6.24.

Top of Page