Re: Convert macros to static inline functions

From: Maxim Orlov <orlovmg(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Convert macros to static inline functions
Date: 2025-01-31 13:29:15
Message-ID: CACG=ezYyER6v39oAtKCZeNKtyc8mOm=YbKMSqNMWeP1z_4UV0g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 23 Jan 2025 at 14:39, Peter Eisentraut <
peter(dot)eisentraut(at)enterprisedb(dot)com> wrote:

> On 27.12.24 11:16, Peter Eisentraut wrote:
> > On 16.05.22 10:27, Peter Eisentraut wrote:
> >> Inspired by [0], I looked to convert more macros to inline functions.
> >
> > This is an older thread where I left something unfinished:
> >
> >> Note 2: Many macros in htup_details.h operate both on HeapTupleHeader
> >> and on MinimalTuple, so converting them to a function doesn't work in
> >> a straightforward way. I have some in-progress work in that area, but
> >> I have not included any of that here.
> >
> > Here is the patch set for this.
>
> I have committed this.
>
Great job! I've been working on the 64 XIDs patch for years, and I've never
liked this place. On the other hand,
as we know, inlining does not always work since it only suggests to the
compiler to do it. After all, many of
these calls are used in pretty "hot" places and every instruction is
important, in my opinion. Wouldn't it be
better to use pg_attribute_always_inline in this particular module?

PFA patch. I don't use pg_attribute_always_inline for fastgetattr and
heap_getattr because they are relatively
large. I think it's worth leaving the possibility for debugging here.

--
Best regards,
Maxim Orlov.

Attachment Content-Type Size
v2-0001-Use-pg_attribute_always_inline-for-static-inline-.patch application/octet-stream 12.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2025-01-31 13:34:48 Re: why there is not VACUUM FULL CONCURRENTLY?
Previous Message Alexander Borisov 2025-01-31 13:13:36 Re: Optimization for lower(), upper(), casefold() functions.