public inbox for [email protected]  
help / color / mirror / Atom feed
From: Aleksander Alekseev <[email protected]>
To: pgsql-hackers <[email protected]>
Cc: zengman <[email protected]>
Subject: Re: [PATCH] Precompute string lengths in PerformRadiusTransaction
Date: Mon, 5 Jan 2026 17:51:58 +0300
Message-ID: <CAJ7c6TNEU+hVAysAQL_2wQizzp6DTWg07FT68XAAJ6i2NsUNdw@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>

Hi,

> 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.

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

-- 
Best regards,
Aleksander Alekseev






view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: [PATCH] Precompute string lengths in PerformRadiusTransaction
  In-Reply-To: <CAJ7c6TNEU+hVAysAQL_2wQizzp6DTWg07FT68XAAJ6i2NsUNdw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox