Re: Popcount optimization for the slow-path lookups - Mailing list pgsql-hackers

From Andrew Pogrebnoi
Subject Re: Popcount optimization for the slow-path lookups
Date
Msg-id CA+aWR10Z1_B+_JaN0+n4zhFvaBNcb3tu3H3Y4jpxiy34BzUXaA@mail.gmail.com
Whole thread Raw
In response to Re: Popcount optimization for the slow-path lookups  (Nathan Bossart <nathandbossart@gmail.com>)
List pgsql-hackers
On Fri, Dec 5, 2025 at 5:40 PM Nathan Bossart <nathandbossart@gmail.com> wrote:
> I don't think the proposed improvements are relevant for either of the
> machines you used for your benchmarks.  For x86, we've optimized our
> popcount code to use SSE4.2 or AVX-512, and for AArch64, we've optimized it
> to use Neon or SVE.  And for other systems, we still try to use
> __builtin_popcount() and friends in the fallback paths, which IIUC are
> available on both gcc and clang (and maybe elsewhere).  IMHO we need to run
> the benchmarks on a compiler/architecture combination where it would
> actually be used in practice.

Yes, I saw that the code is on a rather obscure path, but those machines were my only options for quick benchmarks.
I reasoned that the code path still exists, and eliminating branching there would be beneficial anyway
(most probably). But you are right, we need to test it on target architectures/compilers. I'll try to do with that.

---
Cheers,
Andy

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: More const-marking cleanup
Next
From: Bryan Green
Date:
Subject: Re: [PATCH] Allow complex data for GUC extra.