From: Eduard Bagdasaryan Date: Mon, 2 Jul 2018 12:41:26 +0000 (+0000) Subject: Optimization: Do not create/configure ACLFilledChecklist in vain (#232) X-Git-Tag: M-staged-PR237~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e37f1cd405fbb84ce4168c266f8b7acdc5064ea5;p=thirdparty%2Fsquid.git Optimization: Do not create/configure ACLFilledChecklist in vain (#232) While client_db is required for client-side pools to work, it may be enabled for other reasons, without any client-side pools configured. We should not create and configure useless ACLFilledChecklist objects because those operations are already not trivial today and have a a tendency of becoming more expensive with time. --- diff --git a/src/client_side.cc b/src/client_side.cc index 1e173cd61f..479c26d81c 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -2464,10 +2464,11 @@ ConnStateData::whenClientIpKnown() #if USE_DELAY_POOLS fd_table[clientConnection->fd].clientInfo = NULL; - if (Config.onoff.client_db) { - /* it was said several times that client write limiter does not work if client_db is disabled */ + if (!Config.onoff.client_db) + return; // client delay pools require client_db - auto &pools = ClientDelayPools::Instance()->pools; + const auto &pools = ClientDelayPools::Instance()->pools; + if (pools.size()) { ACLFilledChecklist ch(NULL, NULL, NULL); // TODO: we check early to limit error response bandwith but we