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 20:25:44 -0400
Message-ID: <15882.1538007944@sss.pgh.pa.us> (raw)
In-Reply-To: <20180926235821.zmpxqv66ob7v2ffi@alap3.anarazel.de>
References: <11787.1534530779@sss.pgh.pa.us>
	<2238.1534716465@sss.pgh.pa.us>
	<f5dd41da-911c-fd97-1b78-e0f8c0141897@postgrespro.ru>
	<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>

Andres Freund <andres@anarazel.de> writes:
> On 2018-09-26 19:45:07 -0400, Tom Lane wrote:
>> No, there are no additional layers that weren't there before ---
>> snprintf.c's snprintf() slots in directly where the platform's did before.

> Hm? What I mean is that we can't realistically be faster with the
> current architecture, because for floating point we end up doing glibc
> sprintf() in either case.

Oh, you mean specifically for the float conversion case.  I still say
that I will *not* accept judging this code solely on the float case.
The string and integer cases are at least as important if not more so.

>> Interesting.  strfromd() is a glibc-ism, and a fairly recent one at
>> that (my RHEL6 box doesn't seem to have it).

> It's C99 afaict.

It's not in POSIX 2008, and I don't see it in my admittedly-draft
copy of C99 either.  But that's not real relevant -- I don't see
much reason not to use it if we want a quick and dirty answer for
the platforms that have it.

If we had more ambition, we might consider stealing the float
conversion logic out of the "stb" library that Alexander pointed
to upthread.  It says it's public domain, so there's no license
impediment to borrowing some code ...

			regards, tom lane




view thread (65+ messages)  latest in thread

Message-ID: <15882.1538007944@sss.pgh.pa.us>
Permalink:  ../15882.1538007944@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/15882.1538007944@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: <15882.1538007944@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