Re: equal() perf tweak

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: equal() perf tweak
Дата
Msg-id 87ptg6f5e0.fsf@mailbox.samurai.com
обсуждение исходный текст
Ответ на Re: equal() perf tweak  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: equal() perf tweak  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: equal() perf tweak  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-patches
Tom Lane <tgl@sss.pgh.pa.us> writes:
> This does suggest that it might be worth making the struct layout be
>
>     int NodeTag;
>     int length;
>     foo *head;
>     foo *tail;
>
> since this would avoid some padding overhead on a machine where pointers
> are 8 bytes and need 8-byte alignment.  It probably doesn't help given
> the current implementation of palloc, but why throw away padding
> space?

Interesting. I've heard in some shops it is standard policy to order
the fields in all structs by their descending sizes (making allowances
for platform-specific variations), so as to reduce padding. Do you
think it would be worthwhile to systematically make this kind of
reorganization throughout the backend?

(Of course, we'd need to be weary of code that depends on order of the
fields in structs, naturally -- such as the "NodeTag must be the first
field" rule.)

-Neil


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: equal() perf tweak
Следующее
От: Gaetano Mendola
Дата:
Сообщение: Re: equal() perf tweak