xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
- From: Tatu Saloranta <cowtowncoder AT yahoo.com>
- To: xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] XOM and Large Files
- Date: Wed, 26 Jul 2006 11:31:56 -0700 (PDT)
--- Mike Colbert <mbcolbert AT yahoo.com> wrote:
> --- 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.
Actually, while this can make a positive difference
with Readers, it is generally counter-productive to
wrap InputStreams in BufferedInputStreams, if those
streams are directly passed to XML parsers (which is
the right way -- it's better to let parse detect the
encoding used). Reason is that most (all?) parsers I
know of buffer their input, so adding
BufferedInputStream just adds one unnecessary memory
copy operation to the chain. In grand scheme of
things, this is not a big deal, but just thought I'll
mention it. ;-)
So passing just that FileInputStream (or sequenced
version of the same, or, like Michael suggested,
wrapper doc) is usually the best thing to do.
-+ Tatu +-
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
-
Re: [XOM-interest] XOM and Large Files
, (continued)
- Re: [XOM-interest] XOM and Large Files, Wolfgang Hoschek, 07/26/2006
-
Re: [XOM-interest] XOM and Large Files,
John Cowan, 07/26/2006
-
Re: [XOM-interest] XOM and Large Files,
Mike Colbert, 07/26/2006
-
Re: [XOM-interest] XOM and Large Files,
Elliotte Harold, 07/26/2006
-
Re: [XOM-interest] XOM and Large Files,
Mike Colbert, 07/26/2006
-
Re: [XOM-interest] XOM and Large Files,
Michael Kay, 07/26/2006
- Re: [XOM-interest] XOM and Large Files, Mike Colbert, 07/26/2006
-
Re: [XOM-interest] XOM and Large Files,
Mike Colbert, 07/26/2006
-
Re: [XOM-interest] XOM and Large Files,
Mike Colbert, 07/26/2006
- Re: [XOM-interest] XOM and Large Files, Elliotte Harold, 07/26/2006
-
Re: [XOM-interest] XOM and Large Files,
Mike Colbert, 07/26/2006
-
Re: [XOM-interest] XOM and Large Files,
Tatu Saloranta, 07/26/2006
-
Re: [XOM-interest] XOM and Large Files,
John Cowan, 07/26/2006
- Re: [XOM-interest] XOM and Large Files, Elliotte Harold, 07/26/2006
- Re: [XOM-interest] XOM and Large Files, John Cowan, 07/26/2006
- Re: [XOM-interest] XOM and Large Files, John Cowan, 07/26/2006
- Re: [XOM-interest] XOM and Large Files, Mike Colbert, 07/26/2006
-
Re: [XOM-interest] XOM and Large Files,
John Cowan, 07/26/2006
-
Re: [XOM-interest] XOM and Large Files,
Michael Kay, 07/26/2006
- Re: [XOM-interest] XOM and Large Files, Wolfgang Hoschek, 07/26/2006
- Re: [XOM-interest] XOM and Large Files, Tatu Saloranta, 07/26/2006
- Re: [XOM-interest] XOM and Large Files, Mike Colbert, 07/27/2006
- Re: [XOM-interest] XOM and Large Files, John Cowan, 07/27/2006
-
Re: [XOM-interest] XOM and Large Files,
Mike Colbert, 07/26/2006
-
Re: [XOM-interest] XOM and Large Files,
Elliotte Harold, 07/26/2006
-
Re: [XOM-interest] XOM and Large Files,
Mike Colbert, 07/26/2006
Archive powered by MHonArc 2.6.24.