pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Optimize visibilitymap_count() with AVX-512 instructions.
Date: Sun, 07 Apr 2024 04:00:52 +0000
Message-ID: <E1rtJi8-000ucP-Cg@gemulon.postgresql.org> (raw)

Optimize visibilitymap_count() with AVX-512 instructions.

Commit 792752af4e added infrastructure for using AVX-512 intrinsic
functions, and this commit uses that infrastructure to optimize
visibilitymap_count().  Specificially, a new pg_popcount_masked()
function is introduced that applies a bitmask to every byte in the
buffer prior to calculating the population count, which is used to
filter out the all-visible or all-frozen bits as needed.  Platforms
without AVX-512 support should also see a nice speedup due to the
reduced number of calls to a function pointer.

Co-authored-by: Ants Aasma
Discussion: https://postgr.es/m/BL1PR11MB5304097DF7EA81D04C33F3D1DCA6A%40BL1PR11MB5304.namprd11.prod.outlook.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/41c51f0c68b21b4603bd2a9c3d3ad017fdd22627

Modified Files
--------------
src/backend/access/heap/visibilitymap.c |  25 ++-----
src/include/port/pg_bitutils.h          |  34 +++++++++
src/port/pg_bitutils.c                  | 126 ++++++++++++++++++++++++++++++++
src/port/pg_popcount_avx512.c           |  60 +++++++++++++++
4 files changed, 225 insertions(+), 20 deletions(-)



Message-ID: <E1rtJi8-000ucP-Cg@gemulon.postgresql.org>
Permalink:  ../E1rtJi8-000ucP-Cg@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rtJi8-000ucP-Cg@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: nathan@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Optimize visibilitymap_count() with AVX-512 instructions.
  In-Reply-To: <E1rtJi8-000ucP-Cg@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox