Re: In PG12, query with float calculations is slower than PG11 - Mailing list pgsql-hackers

From Andres Freund
Subject Re: In PG12, query with float calculations is slower than PG11
Date
Msg-id 20200206055531.esv5bhzfhtqrsd2w@alap3.anarazel.de
Whole thread Raw
In response to In PG12, query with float calculations is slower than PG11  (keisuke kuroda <keisuke.kuroda.3862@gmail.com>)
Responses Re: In PG12, query with float calculations is slower than PG11
List pgsql-hackers
Hi,

On 2020-02-06 14:25:03 +0900, keisuke kuroda wrote:
> That's because check_float8_val() (in PG 12) is a function
> whose arguments must be evaluated before
> it is called (it is inline, but that's irrelevant),
> whereas CHECKFLOATVAL() (in PG11) is a macro
> whose arguments are only substituted into its body.

Hm - it's not that clear to me that it is irrelevant that the function
gets inlined. The compiler should know that isinf is side-effect free,
and that it doesn't have to evaluate before necessary.

Normally isinf is implemented by a compiler intrisic within the system
headers. But not in your profile:
> ★ 5.41%  postgres  libc-2.17.so       [.] __isinf

I checked, and I don't see any references to isinf from within float.c
(looking at the disassembly - there's some debug strings containing the
word, but that's it).

What compiler & compiler version on what kind of architecture is this?

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Surafel Temesgen
Date:
Subject: Re: [PATCH v1] Allow COPY "text" format to output a header
Next
From: Andy Fan
Date:
Subject: Re: [PATCH] Erase the distinctClause if the result is unique by definition