From: Amos Jeffries Date: Wed, 27 Apr 2011 23:48:03 +0000 (+1200) Subject: Performance: short-circuit reply_body_max_size ACL tests X-Git-Tag: take07~16^2~52 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4194f58d0f808bfe19bfd212ffe194e5e2064d6e;p=thirdparty%2Fsquid.git Performance: short-circuit reply_body_max_size ACL tests In the common default case there are no reply body limits configured. There is no need to construct ACL checklists for testing. This saves one allocation and several locking/unlocking cycles per request. --- diff --git a/src/HttpReply.cc b/src/HttpReply.cc index ac088509bf..bfa84dbf22 100644 --- a/src/HttpReply.cc +++ b/src/HttpReply.cc @@ -589,6 +589,10 @@ HttpReply::calcMaxBodySize(HttpRequest& request) return; bodySizeMax = -1; + // short-circuit ACL testing if there are none configured + if (!Config.ReplyBodySize) + return; + ACLFilledChecklist ch(NULL, &request, NULL); #if FOLLOW_X_FORWARDED_FOR if (Config.onoff.acl_uses_indirect_client)