Re: Remove redundant assignment of a variable in function AlterPublicationTables - Mailing list pgsql-hackers

From Chao Li
Subject Re: Remove redundant assignment of a variable in function AlterPublicationTables
Date
Msg-id B65DC4FA-312B-4B8C-AB61-55BCA989699E@gmail.com
Whole thread Raw
In response to Re: Remove redundant assignment of a variable in function AlterPublicationTables  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers


On Aug 21, 2025, at 08:11, Michael Paquier <michael@paquier.xyz> wrote:

Compilers are smart enough to optimize such things away

My first impression was compilers would optimize the local variable “isnull", such as replacing it with a constant value. However, “isnull” will be passed into other functions with its pointer, in this specific case, compilers won’t be able to do much optimization on “isnull”. It still needs to allocate “isnull” on stack and assign “true” to it at runtime. But anyway, that’s a tiny cost that we don’t need to worry about.

--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/




pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Remove redundant assignment of a variable in function AlterPublicationTables
Next
From: Richard Guo
Date:
Subject: Re: Reduce "Var IS [NOT] NULL" quals during constant folding