Re: Ryu floating point output patch

Andrew Gierth <andrew@tao11.riddles.org.uk>

From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: pgsql-hackers@lists.postgresql.org
Cc: "David G. Johnston" <david.g.johnston@gmail.com>, Donald Dong <xdong@csumb.edu>, Andres Freund <andres@anarazel.de>, Robert Haas <robertmhaas@gmail.com>, Tom Lane <tgl@sss.pgh.pa.us>, Chapman Flack <chap@anastigmatix.net>
Date: 2019-02-02T20:14:18Z
Lists: pgsql-hackers

Attachments

And another version. (I should have checked upstream before posting the
last one, sigh)

This one incorporates (with heavy adaptations) a new optimization from
upstream, adding a fastpath for values that happen to be small nonzero
integers. The overhead is low enough for this to be worthwhile.

Additionally, I've now micro-optimized the fixed-point output format
code (which is not in upstream), so it no longer makes a noticable
difference to performance.

There probably isn't any need for more optimization here since it's now
measurably faster (sometimes almost 2x faster) than bigint output in all
my tests (which probably means we could improve on bigint's performance,
but that's a job for another day).

-- 
Andrew (irc:RhodiumToad)

Commits

  1. Provide an extra-float-digits setting for pg_dump / pg_dumpall

  2. Change floating-point output format for improved performance.

  3. Use strtof() and not strtod() for float4 input.