RE: SIMD optimization for list_sort

From: "Devulapalli, Raghuveer" <raghuveer(dot)devulapalli(at)intel(dot)com>
To: John Naylor <johncnaylorls(at)gmail(dot)com>, "R, Rakshit" <rakshit(dot)r(at)intel(dot)com>
Cc: Andrei Lepikhov <lepihov(at)gmail(dot)com>, "Giacchino, Luca" <luca(dot)giacchino(at)intel(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, "Shankaran, Akash" <akash(dot)shankaran(at)intel(dot)com>, "Paul, Sourav Kumar" <sourav(dot)kumar(dot)paul(at)intel(dot)com>
Subject: RE: SIMD optimization for list_sort
Date: 2025-02-20 17:25:49
Message-ID: PH8PR11MB82861E07C866BA864E258F2BFBC42@PH8PR11MB8286.namprd11.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> Note that our current implemention is highly optimized for low-cardinality inputs.
> This is needed for aggregate queries. I found this write-up of a couple scalar and
> vectorized sorts, and they show this library doing very poorly on very-low
> cardinality inputs. I would look into that before trying to get something in shape to
> share.
>
> https://github.com/Voultapher/sort-research-
> rs/blob/main/writeup/intel_avx512/text.md

That write up is fairly old and those perf problems has subsequently been fixed. See https://github.com/intel/x86-simd-sort/pull/127 and https://github.com/intel/x86-simd-sort/pull/168. I still suggest measuring perf here for thoroughness.

>
> There is also the question of hardware support. It seems AVX-512 is not
> supported well on client side, where most developers work. And availability of
> any flavor is not guaranteed on server either.
> Something to keep in mind.

simd-sort also works on avx2 which is widely available. I would suggest benchmarking on one of the client laptops to measure the perf.

Raghuveer

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2025-02-20 17:28:36 Re: [PoC] Federated Authn/z with OAUTHBEARER
Previous Message Pavel Stehule 2025-02-20 17:15:36 Re: Proposal: pg_is_volatile function