pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@postgresql.org
Subject: pgsql: Extend & revamp pg_bswap.h infrastructure.
Date: Sat, 30 Sep 2017 00:29:57 +0000
Message-ID: <E1dy5fJ-00081c-3N@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Extend & revamp pg_bswap.h infrastructure.

Upcoming patches are going to address performance issues that involve
slow system provided ntohs/htons etc. To address that expand
pg_bswap.h to provide pg_ntoh{16,32,64}, pg_hton{16,32,64} and
optimize their respective implementations by using compiler intrinsics
for gcc compatible compilers and msvc. Fall back to manual
implementations using shifts etc otherwise.

Additionally remove multiple evaluation hazards from the existing
BSWAP32/64 macros, by replacing them with inline functions when
necessary. In the course of that the naming scheme is changed to
pg_bswap16/32/64.

Author: Andres Freund
Discussion: https://postgr.es/m/20170927172019.gheidqy6xvlxb325@alap3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/510b8cbff15fcece246f66f2273ccf830a6c7e98

Modified Files
--------------
config/c-compiler.m4            |  17 ++++++
configure                       |  24 ++++++++
configure.in                    |   1 +
contrib/btree_gist/btree_uuid.c |   4 +-
src/include/pg_config.h.in      |   3 +
src/include/pg_config.h.win32   |   3 +
src/include/port/pg_bswap.h     | 132 ++++++++++++++++++++++++++++++++--------
src/include/port/pg_crc32c.h    |   2 +-
8 files changed, 159 insertions(+), 27 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


view thread (6+ messages)  latest in thread

Message-ID: <E1dy5fJ-00081c-3N@gemulon.postgresql.org>
Permalink:  ../E1dy5fJ-00081c-3N@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1dy5fJ-00081c-3N@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andres@anarazel.de
  Subject: Re: pgsql: Extend & revamp pg_bswap.h infrastructure.
  In-Reply-To: <E1dy5fJ-00081c-3N@gemulon.postgresql.org>
  References: <E1dy5fJ-00081c-3N@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