Justin Pryzby <pry...@telsasoft.com> writes:
> On Thu, Apr 29, 2021 at 06:35:28PM +0530, Vaibhav Dalvi wrote:
>> If my understanding is correct then '++' is not needed in the
>> above highlighted statement which is leading to overhead.

> I don't think the integer increment during pg_upgrade is a meaningful 
> overhead.
> You could check the compiler's assembly output it may be the same even without
> the ++.

Yeah: if the increment actually costs something, I'd expect the compiler
to optimize it away.  But on a lot of machine architectures, a pointer
post-increment is basically free anyhow.

> I'd suggest to leave it as it's currently written, since the idiom on every
> other line is *r++ = ..., it'd be strange to write it differently here, and
> could end up being confusing or copied+pasted somewhere else.

I agree --- cosmetically, this change isn't an improvement.

(On the other hand, if it were written the other way already, I'd also
argue to leave it like that.  Basically, this sort of change is just not
worth troubling over.  It doesn't improve things meaningfully and it
creates back-patching hazards.)

                        regards, tom lane


Reply via email to