Re: equal() perf tweak

Поиск
Список
Период
Сортировка
От Gaetano Mendola
Тема Re: equal() perf tweak
Дата
Msg-id 3FAA2727.2020502@bigfoot.com
обсуждение исходный текст
Ответ на Re: equal() perf tweak  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-patches
Tom Lane wrote:

> Gaetano Mendola <mendola@bigfoot.com> writes:
>
>>[ use list with master node and circular linking ]
>
>
>>now is very late here ( 04:17 AM ) so I wrote
>>the wrong code ( not checked ) but show the idea of
>>avoid "if".
>
>
> This saves an "if" during addition of a list item, at the cost of
> greater expense during list traversal.  (Instead of a loop termination
> test like "ptr != NULL", you need something like "ptr != master_node".
> This may not take an extra cycle, but only if you can afford to dedicate
> a register to holding the value of master_node within the loop.  That
> hurts, especially on architectures with not very many registers.)


Well, if the same architecture have not so many register I guess don't
have a double prefetch instruction queue and an "if" branch
will hurt/destroy that queue, am I wrong ?

I'm going to post on comp.lang.c++.moderated and
comp.std.c++ in order to have better argumentations



> Anyway, we should build the code that way and then do profiling with and
> without support for constant-cost length().

I totally agree with you.


Regards
Gaetano Mendola


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

Предыдущее
От: Gaetano Mendola
Дата:
Сообщение: Re: equal() perf tweak
Следующее
От: ljb
Дата:
Сообщение: Re: (repost) pgtcl: restore 8.0 compatibility for large obj fix