From: Andres Freund <andres@anarazel.de>
To: pgsql-committers@postgresql.org
Subject: pgsql: Use new overflow aware integer operations.
Date: Wed, 13 Dec 2017 01:01:19 +0000
Message-ID: <E1eOvQF-00075s-D1@gemulon.postgresql.org> (raw)
Use new overflow aware integer operations.
A previous commit added inline functions that provide fast(er) and
correct overflow checks for signed integer math. Use them in a
significant portion of backend code. There's more to touch in both
backend and frontend code, but these were the easily identifiable
cases.
The old overflow checks are noticeable in integer heavy workloads.
A secondary benefit is that getting rid of overflow checks that rely
on signed integer overflow wrapping around, will allow us to get rid
of -fwrapv in the future. Which in turn slows down other code.
Author: Andres Freund
Discussion: https://postgr.es/m/20171024103954.ztmatprlglz3rwke@alap3.anarazel.de
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/101c7ee3ee847bac970c74b73b4f2858484383e5
Modified Files
--------------
contrib/btree_gist/btree_cash.c | 10 +-
contrib/btree_gist/btree_int2.c | 10 +-
contrib/btree_gist/btree_int4.c | 10 +-
contrib/btree_gist/btree_int8.c | 10 +-
contrib/btree_gist/btree_utils_num.h | 2 -
src/backend/utils/adt/array_userfuncs.c | 13 +-
src/backend/utils/adt/cash.c | 39 ++--
src/backend/utils/adt/float.c | 9 +-
src/backend/utils/adt/int.c | 200 ++++-------------
src/backend/utils/adt/int8.c | 377 ++++++++------------------------
src/backend/utils/adt/numeric.c | 41 ++--
src/backend/utils/adt/oracle_compat.c | 18 +-
src/backend/utils/adt/varbit.c | 4 +-
src/backend/utils/adt/varlena.c | 13 +-
14 files changed, 217 insertions(+), 539 deletions(-)
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: Use new overflow aware integer operations.
In-Reply-To: <E1eOvQF-00075s-D1@gemulon.postgresql.org>
References: <E1eOvQF-00075s-D1@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