Re: In PG12, query with float calculations is slower than PG11

From: Andres Freund <andres(at)anarazel(dot)de>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: keisuke kuroda <keisuke(dot)kuroda(dot)3862(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>, Emre Hasegeli <emre(at)hasegeli(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: In PG12, query with float calculations is slower than PG11
Date: 2020-02-07 18:13:29
Message-ID: 20200207181329.d6e22ibtnfc5oblh@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2020-02-07 17:17:21 +0900, Amit Langote wrote:
> I did some tests using two relatively recent compilers: gcc 8 and
> clang-7 and here are the results:

Hm, these very much look like they've been done in an unoptimized build?

> 40.62% postgres postgres [.] ExecInterpExpr
> 9.74% postgres postgres [.] float8_accum
> 6.12% postgres libc-2.17.so [.] __isinf
> 5.96% postgres postgres [.] float8mul
> 5.33% postgres postgres [.] dsqrt
> 3.90% postgres postgres [.] ftod
> 3.53% postgres postgres [.] Float8GetDatum
> 2.34% postgres postgres [.] DatumGetFloat8
> 2.15% postgres postgres [.] AggCheckCallContext
> 2.03% postgres postgres [.] slot_deform_tuple
> 1.95% postgres libm-2.17.so [.] __sqrt
> 1.19% postgres postgres [.] check_float8_array

> HEAD
>
> latency average = 549.071 ms
>
> 31.74% postgres postgres [.] ExecInterpExpr
> 11.02% postgres libc-2.17.so [.] __isinf
> 10.58% postgres postgres [.] float8_accum
> 4.84% postgres postgres [.] check_float8_val
> 4.66% postgres postgres [.] dsqrt
> 3.91% postgres postgres [.] float8mul
> 3.56% postgres postgres [.] ftod
> 3.26% postgres postgres [.] Float8GetDatum
> 2.91% postgres postgres [.] float8_mul
> 2.30% postgres postgres [.] DatumGetFloat8
> 2.19% postgres postgres [.] slot_deform_heap_tuple
> 1.81% postgres postgres [.] AggCheckCallContext
> 1.31% postgres libm-2.17.so [.] __sqrt
> 1.25% postgres postgres [.] check_float8_array

Because DatumGetFloat8, Float8GetDatum, etc aren't functions that
normally stay separate.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2020-02-07 18:24:40 Re: Internal key management system
Previous Message Tels 2020-02-07 17:55:01 Re: In PG12, query with float calculations is slower than PG11