[squid-dev] [PATCH] Rework acl/RegexData optimization to use SBufList
Amos Jeffries
squid3 at treenet.co.nz
Mon Nov 14 05:15:01 UTC 2016
On 14/11/2016 1:11 p.m., Kinkie wrote:
> Hi all,
> the attached patch moves away from hand-rolling a c-string onto
> joining a SBufList for optimizing regexes in RegexData.cc.
>
> You can find attached as a test case the output of squidclient
> mgr:config taken on trunk and on the submitted code. It is slightly
> different in that the new code allows for a longer optimized regex.
> The code is expected to cause a small performance regression on
> parse and reconfigure due to extra data copies. The regression is
> negligible: the attached test cases perform "squid -k parse" in 60
> msec in trunk and 62 on the branch on a warm cache on my i5 macbook
> air.
>
>
> [RFC]
> The code managing case-insensitivity flags is IMO quite complicated
> and not really intuitive: it switches between case-insensitive and
> case-sensitive each time it meets a -i flag. I would like to change
> the behaviour so that a -i flag makes the whole acl case-insensitive;
> this seems to me consistent with the behavior documented in squid.conf
> which does not document the case of multiple -i flags in a single
> regex-type ACL. I'd like feedback on this proposal.
>
I'm aware of a few sites relying on that behaviour.
I think we should accumulate into two SBufList instead, one for -i and
one for +i instead of switching back and forth with potentially lots of
little patterns.
Amos
More information about the squid-dev
mailing list