squid3 comments

From: Tsantilas Christos <chtsanti@dont-contact.us>
Date: Tue, 27 Feb 2007 09:42:30 +0200

Hi all,

   I was looking in squid3 code last days. I read again Adrian's mails
in which he complained about squid3 speed, and cpu usage.

Looking in the code there are a number of code-pieces which can
improved. An example is the call of headersEnd (Francisco Gimeno note
this problem too for squid26) which computed again and again in squid3.
Look in HttpStateData::processReplyHeader (http.cc file) method,
headerEnd called inside httpMsg::parse call:
 const bool parsed = newrep->parse(readBuf, eof, &error);
and then called again some lines after:
header_bytes_read = headersEnd(readBuf->content(), readBuf->contentSize());
These days the http headers can easily be 2k, 4k or more (big urls,
cookies etc) so such calls are really costs.

I also rewrite the parseHttpRequest (client_side.cc file), to not
xmalloc space for url parsing and I modified prepareTransparentURL and
prepareAcceleratedURL functions too to take an extra argument the url
length and to not require url as a null terminated string. OK it was not
difficult but I think that the problem is not only writing something
faster here.
For example the struct HttpParser it is better to be a c++ class (maybe
HttpMsg derived?) and some functions be implemented as methods.

Do you think that such changes in squid3 code make sense?

Regards,
   Christos
Received on Tue Feb 27 2007 - 00:41:16 MST

This archive was generated by hypermail pre-2.1.9 : Thu Mar 01 2007 - 12:00:02 MST