I don't know of a reason why it doesn't do buffered reads.

I do know that the Reader interface is designed for working with characters
whereas the InputStream interface is designed for working with bytes.

Can you recompile with an implementation that does buffered reads and see if
that solves your issues?

Kevin

On Tue, Oct 7, 2008 at 6:36 PM, Aaron <[EMAIL PROTECTED]> wrote:

> Hi Restlet Community,
>
> We've been doing some performance profiling of our system, which uses
> Restlet 1.1-M4 to handle resquests. We noticed that
> org.restlet.util.ByteUtils.toString(Reader) is costing us about 40% of
> our runtime.
>
> We took a peek at the source code and realized this method is reading in
> the payload character-by-character. So this method also stands out in our
> profile in terms of invocation count on java.lang.StringBuilder.append()...
> we see literally millions of calls to append() since it's making a call per
> character of payload.
>
> So we're wondering if it might be better for this to create a very large
> buffer and read everything into that at once? Also, is there a reason that
> it's dealing with characters rather than bytes?
>
> Many thanks for any insights into this...!
>
>
> Best wishes,
> Aaron
>
>
>
>

Reply via email to