hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ossf...@dubioso.net>
Subject Re: Performance issues in ChunkedInputStream
Date Wed, 11 Apr 2007 18:30:54 GMT
Hi Tony,

thanks for the details.

> I looked at the source for BufferedInputStream and it looks like
> it tries to fill the empty space in the buffer each time you read from
> it (for a socket connection it will read more than one packet of data)
> instead of just doing a single read from the underlying stream.

Ok, then the byte-by-byte reading in CIS when parsing the chunk header
might well be the problem. If you want to fix that, you'll have to hack
deeply into CIS. Here is what I would do if I had no other choice:

- extend CIS by a local byte array as a buffer (needs two extra int
  for cursor and fill size)
- change the chunk header parsing to read a bunch of bytes into the
  buffer, then parsing from there
- change all read methods to return leftover bytes from the buffer
  before calling a read on the underlying stream

hope that helps,

To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org

View raw message