Re: Use local buffer for packed numerics

From: David Geier <geidav(dot)pg(at)gmail(dot)com>
To: Andrei Lepikhov <lepihov(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Andreas Karlsson <andreas(at)proxel(dot)se>
Subject: Re: Use local buffer for packed numerics
Date: 2026-11-24 07:45:44
Message-ID: 24485aad-2aa3-448c-bcdf-0683676d5997@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>> It's attached. I saw really good results on x86 but some regressions on
>>> M5. That's why I started working on centralizing the case distinction
>>> work scattered throughout all the macros in set_var_from_num() and have
>>> all functions use that. This also makes the code a lot nicer. This
>>> change isn't complete yet, so I cannot send it to you.
>>>
>>> I'll share the results on my box with you tomorrow. Right now, I don't
>>> have access to my benchmark machine.
>>
>> Attached are the results from my AMD Ryzen 7 9700X. You can see that
>> there are lots of speedups but also lots of regressions. The regressions
>> stem from the additional case distinction for if it's a packed /
>> unpacked varlena that are repeatedly scattered throughout the code via
>> the NUMERIC_ macros.
> I wonder what your compiler is.

I used GCC 15.2.0 for the results I shared.

> I test these numeric-related patches on Intel/AMD/ARM platforms with clang/gcc.
> For GCC, I do recommend using -mstringop-strategy=libcall. It hides the
> performance issue in GCC 12-15.

But that flag is not used by PostgreSQL upstream. So the final code
needs to perform regardless of that flag.

What exactly doesn't work with GCC 12-15? Is this documented somewhere?

--
David Geier

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhijie Hou 2026-11-24 07:46:43 Re: Proposal: Conflict log history table for Logical Replication
Previous Message Nisha Moond 2026-11-24 07:23:59 Re: Conflict Detection and Resolution