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: Mike Colbert <mbcolbert AT yahoo.com>
  • To: Elliotte Harold <elharo AT metalab.unc.edu>
  • Cc: John Cowan <cowan AT ccil.org>, xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] XOM and Large Files
  • Date: Wed, 26 Jul 2006 09:35:19 -0700 (PDT)

--- Elliotte Harold <elharo AT metalab.unc.edu> wrote:

> In that case use a SequenceInputStream to add the root element start and
> end-tags before you read in the data. You really don't want to read
> everything into a String first.
>

Excellent advice!

So, it turns out I had neglected to wrap my Readers in BufferedReaders, as
John
advised. They were in there before, but I changed things around and they fell
out somewhere along the way. So many, many thanks to John for reminding me.
This alone made an order of magnitude speed improvement.

I also dropped the String, and used the SequenceInputStream to write in the
root element, and this is of course a superior approach. Although, the time
savings aren't as noticeable; I would have to do a micro-benchmark and we all
know how that goes, so I won't even bother.

In any case, it's flying now. Many thanks to all!

Mike






Archive powered by MHonArc 2.6.24.

Top of Page