And reading the thread history I realize the problem was already
identified (sorry), however:

> Has anyone else had a chance to try this? I'm surprised to see manual
> buffering behaving so much better than the BufferedReader
> implementation but it does seem to make quite a difference.

Not really that surprising looking at the implementation. Each call to
read(), in addition to the obvious buffer arithmetic etc, results in:

* A lock being acquired.
* ensureOpen() being called, which checks whether the stream was already closed.

One might argue about whether streams should be thread-safe or not,
but in any case I think it is good default behavior to always strive
to do I/O chunk-wise, regardless of whether the expectation is that
the underlying stream is fast (for some definition of fast).

-- 
/ Peter Schuller

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to