[osmosis-dev] Buffered XML input

Brett Henderson brett at bretth.com
Fri Dec 9 09:51:36 GMT 2011


Hi Curt,

On 9 December 2011 01:11, Curt Nowak <nowak at bwl.uni-hildesheim.de> wrote:

> Hi all,
>
> browsing through the code of Omsosis-Xml, I noticed lines like
>
> "inputStream = new FileInputStream(file);"
>
> both in the run() method of
> org.openstreetmap.osmosis.xml.v0_6.FastXmlReader and
> org.openstreetmap.osmosis.xml.v0_6.XmlReader. Maybe I'm overlooking things
> but shouldn't that better be
>
> "inputStream = new BufferedInputStream(new FileInputStream(file));"  ?
>

I'm surprised to see that to be honest.  I could have sworn that I've spent
hours testing out different combinations of IO buffer sizes.  But it would
have been around 4 years ago so I must be wrong :-)

I think compressed streams do buffering anyway so perhaps that is enough
when reading from compressed files, but doesn't explain non-buffered cases.

I don't have an issue with changing it, but I'd like to see some
performance testing first to make sure that buffering provides a
performance improvement.

Brett
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/osmosis-dev/attachments/20111209/742bb19d/attachment.html>


More information about the osmosis-dev mailing list