Re: Re: Abbreviated keys for Numeric

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: Re: Abbreviated keys for Numeric
Дата
Msg-id 20150126235146.GD4655@awork2.anarazel.de
обсуждение исходный текст
Ответ на Re: Re: Abbreviated keys for Numeric  (Peter Geoghegan <pg@heroku.com>)
Ответы Re: Re: Abbreviated keys for Numeric  (Petr Jelinek <petr@2ndquadrant.com>)
Список pgsql-hackers
On 2015-01-26 15:35:44 -0800, Peter Geoghegan wrote:
> On Mon, Jan 26, 2015 at 3:12 PM, Andrew Gierth
> <andrew@tao11.riddles.org.uk> wrote:
> > Obvious overheads in float8 comparison include having to check for NaN,
> > and the fact that DatumGetFloat8 on 64bit doesn't get inlined and forces
> > a store/load to memory rather than just using a register. Looking at
> > those might be more beneficial than messing with abbreviations.
> 
> Aren't there issues with the alignment of double precision floating
> point numbers on x86, too? Maybe my information there is at least
> partially obsolete. But it seems we'd have to control for this to be
> sure.

I think getting rid of the function call for DatumGetFloat8() would be
quite the win. On x86-64 the conversion then should amount to mov
%rd?,-0x8(%rsp);movsd -0x8(%rsp),%xmm0 - that's pretty cheap. Both
instructions have a cycle count of 1 + L1 access latency (4) + 2 because
they use the same exection port. So it's about 12 fully pipelineable
cycles. 2 if the pipeline can kept busy otherwise. I doubt that'd be
noticeable if the conversion were inlined.

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: Re: Abbreviated keys for Numeric
Следующее
От: Jim Nasby
Дата:
Сообщение: Re: Shortcoming in CLOBBER_FREED_MEMORY coverage: disk buffer pointers