Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Performance problem when processing large attribute values

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT ibiblio.org>
  • To: XOM API for Processing XML with Java <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] Performance problem when processing large attribute values
  • Date: Thu, 31 May 2012 08:48:13 -0400

I bet if you profile this you'll find that the parser is using a
StringBuilder (or, worse yet, a StringBuffer) to build up the
attribute. And that it's spending a lot of time resizing the buffer
since it probably starts with a pretty low capacity like 16.

By contrast, when working with PCDATA the parser is using an array
that it doesn't have to resize because it can pass it to XOM in
chunks.

--
Elliotte Rusty Harold
elharo AT ibiblio.org




Archive powered by MHonArc 2.6.24.

Top of Page