pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Alexander Kuzmenkov <a.kuzmenkov@postgrespro.ru>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Performance improvements for src/port/snprintf.c
Date: Wed, 26 Sep 2018 23:21:35 -0400
Message-ID: <4913.1538018495@sss.pgh.pa.us> (raw)
In-Reply-To: <20180927020520.ublgc46h2sj73k47@alap3.anarazel.de>
References: <15785.1536776055@sss.pgh.pa.us>
	<20180926220419.lorxpb564gakdjkz@alap3.anarazel.de>
	<20180926221814.el5nwmkez6zfmzbz@alap3.anarazel.de>
	<14302.1538005507@sss.pgh.pa.us>
	<20180926235821.zmpxqv66ob7v2ffi@alap3.anarazel.de>
	<15882.1538007944@sss.pgh.pa.us>
	<20180927004022.lfhffbj3roxzf5ca@alap3.anarazel.de>
	<20180927005705.shbl3n5hq3t65n2j@alap3.anarazel.de>
	<20180927011814.kpncoksuqq3gy44s@alap3.anarazel.de>
	<17058.1538012681@sss.pgh.pa.us>
	<20180927020520.ublgc46h2sj73k47@alap3.anarazel.de>

Andres Freund <andres@anarazel.de> writes:
> On 2018-09-26 21:44:41 -0400, Tom Lane wrote:
>> BTW, were you thinking of plugging in strfromd() inside snprintf.c,
>> or just invoking it directly from float[48]out?  The latter would
>> presumably be cheaper, and it'd solve the most pressing performance
>> problem, if not every problem.

> I wasn't actually seriously suggesting we should use strfromd, but I
> guess one way to deal with this would be to add a wrapper routine that
> could directly be called from float[48]out *and* from fmtfloat().

Yeah, something along that line occurred to me a bit later.

> Wonder
> if it'd be worthwhile to *not* pass that wrapper a format string, but
> instead pass the sprecision as an explicit argument.

Right, getting rid of the round trip to text for the precision seems
like a win.  I'm surprised that strfromd is defined the way it is and
not with something like (double val, char fmtcode, int precision, ...)

			regards, tom lane




view thread (65+ messages)  latest in thread

Message-ID: <4913.1538018495@sss.pgh.pa.us>
Permalink:  ../4913.1538018495@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4913.1538018495@sss.pgh.pa.us

 · 

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-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, a.kuzmenkov@postgrespro.ru, pgsql-hackers@lists.postgresql.org
  Subject: Re: Performance improvements for src/port/snprintf.c
  In-Reply-To: <4913.1538018495@sss.pgh.pa.us>

* 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