Re: Remove repeated calls to PQserverVersion - Mailing list pgsql-hackers

From Peter Smith
Subject Re: Remove repeated calls to PQserverVersion
Date
Msg-id CAHut+Pt6bTjEHNbT3PiDm8geK6bLUqS5uPsV+dHdA9CXcucMtQ@mail.gmail.com
Whole thread Raw
In response to Re: Remove repeated calls to PQserverVersion  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Remove repeated calls to PQserverVersion  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
On Wed, Jul 14, 2021 at 12:15 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Michael Paquier <michael@paquier.xyz> writes:
> > On Tue, Jul 13, 2021 at 07:02:27PM +1000, Peter Smith wrote:
> >> I found a few functions making unnecessary repeated calls to
> >> PQserverVersion(conn); instead of just calling once and assigning to a
> >> local variable.
>
> > Does it really matter?  PQserverVersion() does a simple lookup at the
> > internals of PGconn.
>
> Yeah, it'd have to be mighty hot code to be worth caring about that,
> and none of these spots look like it could be worth it.

I agree there would be no observable performance improvements.

But I never made any claims about performance; my motivation for this
trivial patch was more like just "code tidy" or "refactor", so
applying performance as the only worthiness criteria for a "code tidy"
patch seemed like a misrepresentation here.

Of course you can judge the patch is still not worthwhile for other
reasons. So be it.

------
Kind Regards,
Peter Smith.
Fujitsu Australia



pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: [PATCH] Pull general SASL framework out of SCRAM
Next
From: Stephen Frost
Date:
Subject: Re: proposal: possibility to read dumped table's name from file