Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] More parsing performance patches

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: Wolfgang Hoschek <whoschek AT lbl.gov>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] More parsing performance patches
  • Date: Fri, 22 Jul 2005 06:19:09 -0400

Wolfgang Hoschek wrote:
Here are some patches for standard XOM XML parsing, simultaneously improving efficiency both in time and space. Overall, the patches improve throughput by roughly a factor 1.5 for a wide range of documents. Memory consumption is reduced, depending on the amount of whitespace-only Text nodes (think pretty-printing and deeply nested structures). It passes all XOM tests.


Scanning the patches the main change seems to be moving from Stack, which is a synchronized Vector, to an ArrayList which is unsynchronized. Is that accurate? Make sense. Shouldn't be too hard to implement. I might want to write my own unsynchronized Stack class just to keep the code cleaner however (not to mention, java.util.Stack is a classic example of the wrong way to use inheritance).

I do suspect you're overestimating the prevalence of whitespace only text nodes. Pretty printing is great for humans but in any sort of XML situation where you care about performance, memory, or size, one of the first things you do is throw away boundary white space, ideally before the document is generated but if not when the document is parsed. XOM makes it very easy to use a NodeFactory that never builds these nodes in the first place.

--
Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim




Archive powered by MHonArc 2.6.24.

Top of Page