Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w5Kts-003931-1M for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 09:51:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5Ktq-00DXLW-2S for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 09:51:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w5Ktq-00DXL9-1E for pgsql-hackers@lists.postgresql.org; Wed, 25 Mar 2026 09:51:42 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w5Kto-00000000wjd-0xvY for pgsql-hackers@lists.postgresql.org; Wed, 25 Mar 2026 09:51:41 +0000 Received: by mail-qt1-x843.google.com with SMTP id d75a77b69052e-50b2b2aa276so51107901cf.3 for ; Wed, 25 Mar 2026 02:51:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774432299; cv=none; d=google.com; s=arc-20240605; b=Jbpu159vGXK0zmaUAIGWJea6pPttsJGvvcpxOQYAdeL3KjygeR4h8rHQCHIxoqLRkx hUxl6XfGUleDe3HmSHlSO/aB6umGsINcYC42YJISIvmS7tSVfFjEYT7t0JNDU6qFShp7 zdSe1WcMOilLzRM9huXq1pPa8WcOb2eua7tsm8IjNVj8FAVtFF/iRNIz5CYtZxqEtv+X ddIdtlwD37ZUaDHQmnS3tHLCPAZIXhPRrI/H4pkVQfKSWr1i40QaqkPZkgzWsFLp0+5C r3XwFO/7nLP3IL9TrcSXv62vtR62Lj6L1p5c15+rOao5+HR++c/b4leKrWFjNJ8Nd9T6 e9Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=mCWfLp7IvL43MfnOT+t9zrWnOu73eYRc/EOKfiO+6kk=; fh=LfEcHOmnbYPNiWD9UJ1cAfLFIuSng3ngY6U6hZE5yVY=; b=FoEyJOkPC4P60n48Av4gI4JALqFFnpUwUE+SN87gBUCW1+ZqCU8gMrdaFwJ87Sb3SL qSCrMUojkpQrgY8bC3c678eT2+/uREsnSoBvzEQQ0g0aIBFXR4eeeIHYGAmQT2hKsh4i DQtgBMSX+tHD/FnLD9xFEz51gh6WPyxMS9mmIQCduXVU9wIaMBVmw+3trDZG6K+WrMuP rn5xIFOlsJp3uzBDqX4ciGzklkrlYN2fbsAUkCDt03jCVlrBd2h8OyqHKIykNC7RIBQp 7kUn/vVVnAaaWIJphPqTGTXP3DHeVpE1MJjSvrVlGiGGBgFhT9d/k4S2c1RdHC63gAcl FvEA==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774432299; x=1775037099; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=mCWfLp7IvL43MfnOT+t9zrWnOu73eYRc/EOKfiO+6kk=; b=Ei/n+6G/a9HcttGH74Az+px45cuByNKF7Cdx0hvNDOn6iEoQj5EdReegWGyW5PCuu5 vMOActHXbxP6gmHIXm7vfsw4JAjWResA/y3gKYe9AXTG9r77hMCtVBYRWCmmQgqZBNjR TiK4VEJ8u+ueJkbk72TBFb0DcnFzpL1zDr0fXQGAvsG1gfWq9vp7cQgw9icFRT78oxSm VyVE4IhjsuSmeb838t05M7tPFmx+0bRY3U1UrIkyOYLx09OUhRnpAkePM4Hz6iVveMXv rAHTc1LF4Zwzc+2lNJVMBge13vmZulisLxQHPnrDQQzUf5uNsJ+qOVxNvjRtX5f4uSo7 w6nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774432299; x=1775037099; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=mCWfLp7IvL43MfnOT+t9zrWnOu73eYRc/EOKfiO+6kk=; b=DVlncGCTLHENGqnaq34EzHLAr4FbR2NBMwyKdodJsgMkphNqR14JX2zmXTxeOL22bw XgqHVas50pVAsJPAZmUDf4ivd54Vd59n/8BcxCCSqscj67fXCozEvQhs7a9prPLdpuyO FRU8878roDnKkpfDaDmcee9P+jvi8pGd4vU6jlAlW8oLHhlhzP2hyzOgLmCn/q70rgQ7 ksQoTgZv1FEXT9khINOh2GSXOReFjuxS9Euv3vNA8YL0AHDBtrLW2z606tI2HXyE4keW 7WRAubkQ+RyM6IXo1zqE8tiy0m5R3V/7ovoMKbTvARTBK37lJsr+lgeFwBZVPalfbyue YTsg== X-Gm-Message-State: AOJu0YzZIKvAmH7fRWaJoq56f87PeZhueaNXYiKLoxD7ZgOGT7LXUeSs G0rGHMELTGGVAXsWj5YUe/iKskG2oY+bJ26K0EU9s4AbDMfw/lnoDo70D1WJzQc0n9Cr9iyYRcd Uds2urMBfLxYqUrzAh3URQ/AVzxn41f8zMroXyE46hQ== X-Gm-Gg: ATEYQzyCQHX/hsyGVaUS6Ls+ZY1AfdlaHLo7rbC+5pblSQpehPU0oORmRIezdWci+3H BHuPy5btzfhS+jknRr+ts31a7ktXe3Fp6wiB1V148jl2s6XyiA5RnxR9X+pJgLDT2FUd1eqqeWf KfeGh/Wz34relaRMAYPAQYdKqmvQ8HZMwbVybk+ROvO9sK7CdvjGZBtqVOmzl8ELpyHfwcziicU KZyJ7tvmrEs5AvxkoOBpDwBRdeOoPqnmNm+ZzOfWYKyBUoEuaiQgzRyuKZUyuh96MUcV729FauM iZvR5DH2lJDZ3Fl8RyyEE0JM+vmRF9s18BmsUjipVrD8w7evEOhtfPFUXMAqzqeTO1da8yDPhEg CGXBV/ulzaUSc41rFewSaKCiaeuI= X-Received: by 2002:a05:622a:5a9a:b0:509:27c7:e952 with SMTP id d75a77b69052e-50b80ebad46mr40357861cf.69.1774432298671; Wed, 25 Mar 2026 02:51:38 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: John Naylor Date: Wed, 25 Mar 2026 16:51:26 +0700 X-Gm-Features: AaiRm51Qt7ZN9LRWX2TaBlo8xafxF2QYsymIL_QXhdHPQ7Js_gaio1ijb2Qgp2Y Message-ID: Subject: Re: [PATCH] Precompute string lengths in PerformRadiusTransaction To: zengman Cc: pgsql-hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Jan 5, 2026 at 9:36=E2=80=AFPM zengman wro= te: > I noticed that the `PerformRadiusTransaction` function is invoked in a lo= op, > and the function itself contains internal loops that repeatedly call strl= en() on the 'passwd' and 'secret' strings. > While the optimization gain may be minimal, I still think it=E2=80=99s wo= rth making the change =E2=80=94 > we can precompute the lengths of these two strings at the start of the fu= nction to eliminate redundant strlen() calls. Shortly after you posted this, it was decided that we're going to remove this method entirely: https://wiki.postgresql.org/wiki/RADIUS --=20 John Naylor Amazon Web Services