Re: bg worker: patch 1 of 6 - permanent process

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: bg worker: patch 1 of 6 - permanent process
Дата
Msg-id 25091.1283179957@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: bg worker: patch 1 of 6 - permanent process  (Markus Wanner <markus@bluegap.ch>)
Ответы Re: bg worker: patch 1 of 6 - permanent process  (Markus Wanner <markus@bluegap.ch>)
Список pgsql-hackers
Markus Wanner <markus@bluegap.ch> writes:
> AFAICT we currently have three fixed size blocks to manage shared 
> buffers: the buffer blocks themselves, the buffer descriptors, the 
> strategy status (for the freelist) and the buffer lookup table.

> It's not obvious to me how these data structures should perform better 
> than a dynamically allocated layout.

Let me just point out that awhile back we got a *measurable* performance
boost by eliminating a single indirect fetch from the buffer addressing
code path.  We used to have an array of pointers pointing to the actual
buffers, and we removed that in favor of assuming the buffers were
laid out in a contiguous array, so that the address of buffer N could be
computed with a shift-and-add, eliminating the pointer fetch.  I forget
exactly what the numbers were, but it was significant enough to make us
change it.

So I don't have any faith in untested assertions that we can convert
these data structures to use dynamic allocation with no penalty.
It's very difficult to see how you'd do that without introducing a
new layer of indirection, and our experience shows that that layer
will cost you.
        regards, tom lane


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

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Assertion failure on HEAD (or at least git copy of it)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Assertion failure on HEAD (or at least git copy of it)