Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XOM and Large Files

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: John Cowan <cowan AT ccil.org>
  • To: Mike Colbert <mbcolbert AT yahoo.com>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] XOM and Large Files
  • Date: Thu, 27 Jul 2006 00:45:17 -0400

Mike Colbert scripsit:

> The file content was then passed as a String to a StringReader, then
> to the Builder.

You're using the InputStream inefficiently, since it's not buffered.
That's what kills performance. Anything done after that doesn't matter.

> I then scrapped the whole idea of reading the file content into a String
> in favor of passing a SequencedInputStream on a FileInputStream (with
> root element start and end tags sequenced in) directly to the Builder.
> performance gains. And no explicit buffering.

Okay, in this case Builder gets an InputStream and passes it to the
parser, which buffers it internally, possibly using a BufferedInputStream
or possibly with its own mechanism. Big win.

--
John Cowan cowan AT ccil.org http://ccil.org/~cowan
If a soldier is asked why he kills people who have done him no harm, or a
terrorist why he kills innocent people with his bombs, they can always
reply that war has been declared, and there are no innocent people in an
enemy country in wartime. The answer is psychotic, but it is the answer
that humanity has given to every act of aggression in history. --Northrop
Frye




Archive powered by MHonArc 2.6.24.

Top of Page