[PATCH] Precompute string lengths in PerformRadiusTransaction

From: zengman <zengman(at)halodbtech(dot)com>
To: pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: [PATCH] Precompute string lengths in PerformRadiusTransaction
Date: 2026-01-05 14:36:18
Message-ID: tencent_6B29EC4570E6F0C659B4EAA7@qq.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
0001-Precompute-string-lengths-in-PerformRadiusTransactio.patch application/octet-stream 3.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Álvaro Herrera 2026-01-05 14:38:59 Re: [PATCH} Move instrumentation structs
Previous Message jian he 2026-01-05 14:30:04 Re: [PATCH] Add pg_get_policy_ddl() function to reconstruct CREATE POLICY statement