pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Optimise numeric division for 3 and 4 base-NBASE digit divisors.
Date: Mon, 23 Jan 2023 12:00:25 +0000
Message-ID: <E1pJvUu-0053zr-O4@gemulon.postgresql.org> (raw)

Optimise numeric division for 3 and 4 base-NBASE digit divisors.

On platforms with 128-bit integer support, introduce a new function
div_var_int64(), along the same lines as div_var_int() added in
d1b307eef2 for divisors with 1 or 2 base-NBASE digits, and use it to
speed up div_var() and div_var_fast() in a similar way when the
divisor has 3 or 4 base-NBASE digits.

This gives significant performance gains for divisors with 9-16
decimal digits.

Joel Jacobson.

Discussion:
  https://postgr.es/m/b7a5893d-af18-4c0b-8918-96de5f1bbf39%40app.fastmail.com
  https://postgr.es/m/CAEZATCXGm%3DDyTq%3DFrcOqC0gPMVveKUYTaD5KRRoajrUTiWxVMw%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0aa38db56bf459d04ed58c22f7c689c0ae14e977

Modified Files
--------------
src/backend/utils/adt/numeric.c | 167 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 167 insertions(+)



Message-ID: <E1pJvUu-0053zr-O4@gemulon.postgresql.org>
Permalink:  ../E1pJvUu-0053zr-O4@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pJvUu-0053zr-O4@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: dean.a.rasheed@gmail.com
  Subject: Re: pgsql: Optimise numeric division for 3 and 4 base-NBASE digit divisors.
  In-Reply-To: <E1pJvUu-0053zr-O4@gemulon.postgresql.org>
  References: <E1pJvUu-0053zr-O4@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