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