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: pgsql-hackers@lists.postgresql.org, Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Andrew Gierth <andrew@tao11.riddles.org.uk>
Cc: Alexander Kuzmenkov <a.kuzmenkov@postgrespro.ru>
Subject: Re: Performance improvements for src/port/snprintf.c
Date: Wed, 03 Oct 2018 12:07:32 -0400
Message-ID: <26510.1538582852@sss.pgh.pa.us> (raw)
In-Reply-To: <20181003155207.b3lqmovuv2c5c4id@alap3.anarazel.de>
References: <20180926235821.zmpxqv66ob7v2ffi@alap3.anarazel.de>
	<15882.1538007944@sss.pgh.pa.us>
	<20180927004022.lfhffbj3roxzf5ca@alap3.anarazel.de>
	<20180927005705.shbl3n5hq3t65n2j@alap3.anarazel.de>
	<87r2hffwda.fsf@news-spur.riddles.org.uk>
	<CAEepm=1-3AG2O25VNnLXsjCM3EHBLW=jyJtpp_AMGG6a-GRJZA@mail.gmail.com>
	<6FEC34CD-B8C0-44E2-8D1F-2320568BDC78@anarazel.de>
	<30551.1538517271@sss.pgh.pa.us>
	<20181003060936.zul7mfkcu5w7rotg@alap3.anarazel.de>
	<25583.1538569214@sss.pgh.pa.us>
	<20181003155207.b3lqmovuv2c5c4id@alap3.anarazel.de>

Andres Freund <andres@anarazel.de> writes:
> FWIW, it seems that using a local buffer and than pstrdup'ing that in
> float8out_internal is a bit faster, and would probably save a bit of
> memory on average:
> float8out using sprintf via pg_double_to_string, pstrdup:
> 15370.774
> float8out using strfromd via pg_double_to_string, pstrdup:
> 13498.331

[ scratches head ... ]  How would that work?  Seems like it necessarily
adds a strlen() call to whatever we'd be doing otherwise.  palloc isn't
going to be any faster just from asking it for slightly fewer bytes.
I think there might be something wrong with your test scenario ...
or there's more noise in the numbers than you thought.

			regards, tom lane




view thread (65+ messages)  latest in thread

Message-ID: <26510.1538582852@sss.pgh.pa.us>
Permalink:  ../26510.1538582852@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26510.1538582852@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, thomas.munro@enterprisedb.com, andrew@tao11.riddles.org.uk, a.kuzmenkov@postgrespro.ru
  Subject: Re: Performance improvements for src/port/snprintf.c
  In-Reply-To: <26510.1538582852@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