Re: performance: use pread instead of lseek+read

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: performance: use pread instead of lseek+read
Дата
Msg-id 5494.1046120638@sss.pgh.pa.us
обсуждение исходный текст
Ответ на performance: use pread instead of lseek+read  (Manfred Spraul <manfred@colorfullife.com>)
Ответы Re: performance: use pread instead of lseek+read  (Manfred Spraul <manfred@colorfullife.com>)
Список pgsql-patches
Manfred Spraul <manfred@colorfullife.com> writes:
> What about removing lseek entirely and using the p{read,write}?

Portability.

$ man pread
No manual entry for pread.
$

It seems unlikely to me that eliminating lseek on some platforms would
be worth the hassle of maintaining two code paths.  lseek is mighty
cheap as system calls go.  What's worse, a series of preads (as opposed
to reads without intervening lseek) might not trigger kernel read-ahead
optimizations, in which case this would be a tremendous disimprovement.

> Attached is a patch vs the cvs tree.
> It seems to work - 7.3.2 with the patch applied passes the regression

Can you measure any performance benefit?

            regards, tom lane

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: to_char PL/MI fix
Следующее
От: Manfred Spraul
Дата:
Сообщение: Re: performance: use pread instead of lseek+read