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: SQUID_4_2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=efdaea49927a10712d57b861c62b44cccd3534a4;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 82556c2ec3..ae3d96af38 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -2463,10 +2463,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 - ClientDelayPools& pools(Config.ClientDelay.pools); + ClientDelayPools& pools(Config.ClientDelay.pools); + if (pools.size()) { ACLFilledChecklist ch(NULL, NULL, NULL); // TODO: we check early to limit error response bandwith but we