Re: Add new for_each macros for iterating over a List that do not require ListCell pointer

From: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
To: Nathan Bossart <nathandbossart(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, David Rowley <dgrowleyml(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add new for_each macros for iterating over a List that do not require ListCell pointer
Date: 2024-01-03 21:57:07
Message-ID: CAGECzQT_BUONYWLrUfuAC0rQcWiSddzv9EN+VvihNqnoVrtMKQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 3 Jan 2024 at 20:55, Nathan Bossart <nathandbossart(at)gmail(dot)com> wrote:
>
> I spent some time preparing this for commit, which only amounted to some
> light edits. I am posting a new version of the patch in order to get one
> more round of cfbot coverage and to make sure there is no remaining
> feedback.

Overall your light edits look good to me. The commit message is very
descriptive and I like the shortening of the comments. The only thing
I feel is that I think lost some my original intent is this sentence:

+ * different types. The outer loop only does a single iteration, so we expect
+ * optimizing compilers will unroll it, thereby optimizing it away.

The "we expect" reads to me as if we're not very sure that compilers
do this optimization. Even though we are quite sure. Maybe some small
changes like this to clarify that.

The outer loop only does a single iteration, so we expect that **any**
optimizing compilers will unroll it, thereby optimizing it away. **We
know for sure that gcc and clang do this optimization.**

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2024-01-03 22:13:11 Re: Add new for_each macros for iterating over a List that do not require ListCell pointer
Previous Message Pavel Luzanov 2024-01-03 21:22:45 Re: Things I don't like about \du's "Attributes" column