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