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 1vclwM-00AcUy-2K for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Jan 2026 14:52:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vclwL-002Q9v-1M for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Jan 2026 14:52:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vclwL-002Q9l-0J for pgsql-hackers@lists.postgresql.org; Mon, 05 Jan 2026 14:52:13 +0000 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vclwJ-004hMW-0q for pgsql-hackers@lists.postgresql.org; Mon, 05 Jan 2026 14:52:13 +0000 Received: by mail-ot1-x330.google.com with SMTP id 46e09a7af769-7c75b829eb6so13295a34.1 for ; Mon, 05 Jan 2026 06:52:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tigerdata.com; s=google; t=1767624729; x=1768229529; 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=p9HPyxqMP7VreMuzhq7/O9lorXd1JtUfFaLH1BWYZ44=; b=kjqdZPg2uQOTV24KEECiR+9qFIbgLlx5+zGQxWOuHlmTX7vPNmdE5gDNsz4ODxAekF hCq66hE/Xw2mm8oW4JKkWA263bwqrqYdrDYG7gmxtXN73SnwmokGnlB/k1Ex2LeFSi19 Ccd2dy4hezyeXUBfTDb4p4M+62SJVH/IzYTK+fahevvGVawjuZUbETM4fbUVR1PBxAtA LI4fuBnn74hA834+p5GoyoREO8GTZluxREoBBaiLorDs1Sco7aTzDiyijcFvY1vhlj2c GDtlGAgDIMg/giUB0DdS2i9Ck50KLeZclU/pKfZlKp7/GtYyCuuBTbzzQrvt6zc1JNP+ TlVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767624729; x=1768229529; 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=p9HPyxqMP7VreMuzhq7/O9lorXd1JtUfFaLH1BWYZ44=; b=hM3zel8wOQi7hPluqgT2vbA95WBrm83hoREqgpundEuhS7MN5lS+Fu6WgM+10KD0Er +4tIqatva+VVZMkyJo++M0FcCESk941skvhf234kNRCywuHwvLp7/fPuzDbYUlGevPKe EWx1bH2RXbf/H/eUQJzAmLWPn08lC+SV7zPoYBU1FWrlPVfYDwtsaTdkX2LY0S0LN8Q3 rpdB+JRELduIWRwZi1593uw/c88k2fthqJ4hN9biGKHY7GKPQ/PN7IBKYsRHwbR1J8uZ MAe4Rs1PK4EyPtIyYKjeMoHrc+gpk7bPH2E785/q7FRg/f55oWgkDnk0ormb70gV3edV aFDw== X-Gm-Message-State: AOJu0YwtTYp6bA/S5OMidob6rtXwGdvmAfGW8qQqezMzTTM5XW8+THfa hxBWMgs6X7gkKtzgrDjy8/2n5rExMLScq7ChtSJGICDEfuEviedlcjYifwS4SyPIEpTZIHMe/dh KYwRKugxLDd/tV8sXYKhDyaoyEoSzzroQQda1fOnW+dUDzBd62j9APUwhW2U3 X-Gm-Gg: AY/fxX7yU+2SeqGvYtDU7dxf2O7J6ps3fCjwEj/EHyr6EC2C1K8vABzk/u/kRmTWd21 LjDzgduBQ7bw3+1INxcIreAB+rj3XBfmBxBdZfQCtEIJ98VMt4Rwg4eE/zzPfu1XOZjc0yQ7MFn fgIFmdr93UrurWfrL5CsXf6nQeGxxepc5yYjTomvsRR0lHpxRNB9EG+Mu3M548Vq9A4zOvNcMep UwCNpDsSwLk5EJJpX3HGsQl0k/UbpFfzs2XNSNpmflVbzQ9BxybQZzFLcLC0n56dL1S5DFejNni 1gQWnc4= X-Google-Smtp-Source: AGHT+IGF3SA+A0kED09XaU14YBV7bq7j6BvfdBggYh8Zl/x1UAjXy7GTGSiL+Z9i6VY+WCae3eQv4VMB0q86f8fbWSg= X-Received: by 2002:a05:6830:4429:b0:7c6:cf19:1dec with SMTP id 46e09a7af769-7cc66a35af6mr20984421a34.33.1767624729077; Mon, 05 Jan 2026 06:52:09 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Aleksander Alekseev Date: Mon, 5 Jan 2026 17:51:58 +0300 X-Gm-Features: AQt7F2o9WTDmuOJeae0SHQ9vYs6EWxbMLzYpdVQdtu8DqjUjuCtgNOSgVAP2dIQ Message-ID: Subject: Re: [PATCH] Precompute string lengths in PerformRadiusTransaction To: pgsql-hackers Cc: zengman 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 Hi, > 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. Good find. We may also consider making both passwd_len and secret_len `cons= t`. --=20 Best regards, Aleksander Alekseev