[squid-dev] [WTF] HttpHeader strangenesses

Kinkie gkinkie at gmail.com
Mon Aug 10 20:13:47 UTC 2015


I'm going over HttpHeader to see if there's any possible improvements to be
obtained by dragging it (kicking and screaming, from the look of it) into
the 10's.

Here's a list of weirdnesses I'm coming to find, hopefully someone has any
idea of WHY they are like this, or if they can be safely be removed:

- HttpHeader::insertTime makes no sense. It's O(N) and it's always used in
two patterns: delById(HDR); insertTime(HDR) and if (!has(HDR)
insertTime(HDR)).
I've replaced with putTime everywhere
- why doesn't HttpHeaderEntry use a copy-constructor, relying instead in a
clone() method?
- why the strange loop in HttpHeader's copy-constructor? Replaced with a "=
default", it should be just fine..
- statistics accounting: we count A LOT (see HttpHeader::clean) Is it
really worth it in a performance-critical code as this? Maybe we could
shuffle things around to HttpHeader and HttpHeaderEntry's ctor and dtor ..

More to come as I cross them.
(work in progress at lp:~kinkie/squid/coverity-fixes)

-- 
    Francesco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-dev/attachments/20150810/32d41505/attachment.html>


More information about the squid-dev mailing list