Re: Ryu floating point output patch

From: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Ryu floating point output patch
Date: 2018-12-14 20:37:46
Message-ID: 871s6jzxdd.fsf@news-spur.riddles.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>>>> "Andres" == Andres Freund <andres(at)anarazel(dot)de> writes:

>> Is this a path we really want to go down? I'm not convinced the
>> cost/benefit ratio is attractive.

Andres> float->text conversion is one of the major bottlenecks when
Andres> backing up postgres, it's definitely a pain-point in practice.

Also an issue with queries. I got into this whole area after diagnosing
a problem for a user on IRC who was seeing a 4x slowdown for PG as
compared to MSSQL, from 30 seconds to 120 seconds. We determined that
the _entire_ difference was accounted for by float conversion.

Now that was an unusual case, downloading a large dataset of floats at
once into a statistics program, but it's very easy to show
proportionally large overheads from float output:

(using this table:
create table flttst4 as
select i a, i b, i c, i d, i::float8 e, random() f
from generate_series(1::bigint, 10000000::bigint) i;
)

postgres=# copy flttst4(d) to '/dev/null'; -- bigint column
COPY 10000000
Time: 2166.001 ms (00:02.166)

postgres=# copy flttst4(e) to '/dev/null'; -- float8 col, integer values
COPY 10000000
Time: 4233.005 ms (00:04.233)

postgres=# copy flttst4(f) to '/dev/null'; -- float8 col, random()
COPY 10000000
Time: 7261.421 ms (00:07.261)

-- vs. timings with Ryu:

postgres=# copy flttst4(e) to '/dev/null'; -- float8 col, integer values
COPY 10000000
Time: 2391.725 ms (00:02.392)

postgres=# copy flttst4(f) to '/dev/null'; -- float8 col, random()
COPY 10000000
Time: 2245.699 ms (00:02.246)

--
Andrew (irc:RhodiumToad)

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-12-14 20:43:06 Re: ExecBuildGroupingEqual versus collations
Previous Message Tom Lane 2018-12-14 20:34:21 Re: ExecBuildGroupingEqual versus collations