tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ed Korthof ...@apache.org>
Subject Re: Ajpv12InputStream.java bit op dillema
Date Fri, 02 Jun 2000 23:33:39 GMT
On Fri, 2 Jun 2000 costin@costin.dnt.ro wrote:

> One thing that will help - and should be done - is to
> use the ByteBuffer.

I'll check this out ... umm ... do you mean ByteArrayInputStream?  Or just
putting a lot of data into a big byte[]?

> The full message will be available and you can access individual
> bytes. What's good is that you don't have to construct the strings until
> they are needed - and most of the time they are not ( very few 
> servlets will read all headers ).
> 
> Given the fact that one request creates 50..100 strings - it will make
> a difference. And you can feel it - for example the new HttpAdapter
> (using the ByteBuffer) is visibly faster than the previous one ( that
> uses byte[] for parsing but normal read()) , which is faster than the
> original one ( using a lot of substrings ). 
> 
> ( visibly == 5.. 10 % )

Sometimes the effect is much more than this.  A while ago, some changes we
did to the JServ protocol (which removed the use of StringTokenizers)
improved efficiency of a relevant operation by more than 60%.  The effect
was quite striking.

Anyway, this is the sort of stuff which I find interesting, so I'll look
at the current code ... I'm assuming it makes more sense to tune Tomcat
than Catalina, right now?

Ed


Mime
View raw message