Re: [PATCH] Precompute string lengths in PerformRadiusTransaction - Mailing list pgsql-hackers

From Aleksander Alekseev
Subject Re: [PATCH] Precompute string lengths in PerformRadiusTransaction
Date
Msg-id CAJ7c6TNEU+hVAysAQL_2wQizzp6DTWg07FT68XAAJ6i2NsUNdw@mail.gmail.com
Whole thread Raw
In response to [PATCH] Precompute string lengths in PerformRadiusTransaction  ("zengman" <zengman@halodbtech.com>)
Responses Re: [PATCH] Precompute string lengths in PerformRadiusTransaction
List pgsql-hackers
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



pgsql-hackers by date:

Previous
From: Álvaro Herrera
Date:
Subject: Re: [PATCH} Move instrumentation structs
Next
From: Antonin Houska
Date:
Subject: Re: Adding REPACK [concurrently]