Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Performance problems with very large attribute strings

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: XOM API for Processing XML with Java <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] Performance problems with very large attribute strings
  • Date: Sun, 6 Oct 2013 10:28:31 +0100

>
> Would there be any difference between attribute content and element
> content?
>

I think it's more likely that parser designers have thought carefully about
how to handle long text nodes than about how to handle very long attributes.

For example, the SAX interface allows character data to be broken up into
chunks as the parser sees fit, and to be passed as a reference into a char[]
array, whereas attribute values have to be passed as a single String. It
wouldn't surprise me if the case of attribute values crossing buffer
boundaries is considered sufficiently rare that a simple string concatenation
is used, which implies quadratic performance as the attribute length
increases. That's pure conjecture, but it seems consistent with what you are
seeing.

Michael Kay
Saxonica





Archive powered by MHonArc 2.6.24.

Top of Page