Subject: [PATCH] Precompute string lengths in PerformRadiusTransaction

From: "zengman" <[email-masked]>
Date: Mon, 5 Jan 2026 22:36:18 +0800

Hi, hackers

I noticed that the `PerformRadiusTransaction` function is invoked in a loop, 
and the function itself contains internal loops that repeatedly call strlen() on the 'passwd' and 'secret' strings. 
While the optimization gain may be minimal, I still think it’s worth making the change — 
we can precompute the lengths of these two strings at the start of the function to eliminate redundant strlen() calls.

--
Regards,
Man Zeng
www.openhalo.org

---

From: Aleksander Alekseev <[email-masked]>
Date: Mon, 5 Jan 2026 17:51:58 +0300

Hi,

> we can precompute the lengths of these two strings at the start of the function to eliminate redundant strlen() calls.

Good find. We may also consider making both passwd_len and secret_len `const`.

-- 
Best regards,
Aleksander Alekseev

---

From: John Naylor <[email-masked]>
Date: Wed, 25 Mar 2026 16:51:26 +0700

> we can precompute the lengths of these two strings at the start of the function 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

-- 
John Naylor
Amazon Web Services

---

From: "zengman" <[email-masked]>
Date: Wed, 25 Mar 2026 18:58:00 +0800

Hi,

Okay, thank you very much for reminding me. I'll retract this patch.

--
regards,
Man Zeng