pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@postgresql.org
Subject: pgsql: Improve speed of timestamp/time/date output functions.
Date: Sun, 07 Feb 2016 04:11:40 +0000
Message-ID: <E1aSGhI-0004cN-Hn@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Improve speed of timestamp/time/date output functions.

It seems that sprintf(), at least in glibc's version, is unreasonably slow
compared to hand-rolled code for printing integers.  Replacing most uses of
sprintf() in the datetime.c output functions with special-purpose code
turns out to give more than a 2X speedup in COPY of a table with a single
timestamp column; which is pretty impressive considering all the other
logic in that code path.

David Rowley and Andres Freund, reviewed by Peter Geoghegan and myself

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/aa2387e2fd532954e88dfd8546ab894b9305123d

Modified Files
--------------
src/backend/utils/adt/datetime.c | 389 ++++++++++++++++++++++++++-------------
src/backend/utils/adt/numutils.c | 161 ++++++++++++++++
src/include/utils/builtins.h     |   2 +
3 files changed, 424 insertions(+), 128 deletions(-)


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


Message-ID: <E1aSGhI-0004cN-Hn@gemulon.postgresql.org>
Permalink:  ../E1aSGhI-0004cN-Hn@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1aSGhI-0004cN-Hn@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: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Improve speed of timestamp/time/date output functions.
  In-Reply-To: <E1aSGhI-0004cN-Hn@gemulon.postgresql.org>
  References: <E1aSGhI-0004cN-Hn@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