Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Canonicalizer Performance

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: "Michael Kay" <mike AT saxonica.com>
  • To: "'Sean Truman'" <struman AT nuparadigm.com>, "'Elliotte Harold'" <elharo AT metalab.unc.edu>, "'xom-interest'" <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] Canonicalizer Performance
  • Date: Mon, 28 Aug 2006 19:13:22 +0100

> I have profiled, and it is hanging in the XPath Query
>
> write(node.query(".//. | .//@* | .//namespace::*"));

If you have 30,000 elements in your document, and each has an average of
1000 namespace prefixes in scope, then there will be 30,000,000 namespace
nodes in the document, so whatever technology you use, this query is going
to be seriously slow.

Even if it's not as bad as that, however, most XML software is likely to be
optimized for the case where the number of namespace bindings in a document
doesn't exceed a dozen or so. That's certainly the case with Saxon, for
example lookup of namespace prefixes always uses a serial search.

Whoever designed this was wantonly careless about the practical
implications.

Michael Kay
http://www.saxonica.com/





Archive powered by MHonArc 2.6.24.

Top of Page