Re: remove BufferBlockPointers for speed and space

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: remove BufferBlockPointers for speed and space
Дата
Msg-id 4394.1123823662@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: remove BufferBlockPointers for speed and space  ("Qingqing Zhou" <zhouqq@cs.toronto.edu>)
Список pgsql-patches
"Qingqing Zhou" <zhouqq@cs.toronto.edu> writes:
> I've patched the code according to your suggestion. Result is:
> [ snip ]

OK, that test seems a little more believable.  One point you didn't
consider is that on 64-bit machines, the integer bufnum really has
to be coerced to size_t to avoid overflow if the buffer array exceeds
2Gb.  (Which we don't support today, but might well by the end of
day tomorrow, seeing that there's a patch in the queue about it.)
But I ran the test case with the extra coercion on an IA64 machine at
Red Hat, and got substantially the same results as you did: the array
method is just slower.  Another consideration is that the array is
competing for L2 cache --- the test program can't really show that,
since it has no other use for L2 cache, but in the context of the real
database I suspect this is at least as much of a win as shaving a few
nanoseconds off the BufferGetBlock macro itself.

So ... patch applied, and thanks for the good idea!

            regards, tom lane

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Bug in canonicalize_path()
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Bug in canonicalize_path()