Re: Missed compiler optimization issue in function select_rtable_names_for_explain

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: XChy <xxs_chy(at)outlook(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Missed compiler optimization issue in function select_rtable_names_for_explain
Date: 2024-05-22 18:12:36
Message-ID: 8912D37E-1FEB-4772-9BA2-2E5F4D940684@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On 22 May 2024, at 13:00, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> wrote:

> I think if we want to improve how this code is seen by the compiler by
> modifying it, we should just remove the NULL/NIL assignments.

*If* the optimization is measurable, IMHO.

> It's a
> pretty arbitrary (and rather small) subset of fields being initialized,
> fields which very obviously have been zeroed by memset already, so I
> don't see any value in the explicit assignments.

My personal opinion is that there is value in immediately knowing the type of
the members from the inits, in this case I know without looking up the
definition that some of the members are list. I like that readability. That
being said, I for sure won't fight if there is concensus to remove.

--
Daniel Gustafsson

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Daniel Gustafsson 2024-05-22 18:14:10 Re: Missed compiler optimization issue in function select_rtable_names_for_explain
Previous Message Alban Hertroys 2024-05-22 18:07:25 Re: Finding "most recent" using daterange