Re: performance: use pread instead of lseek+read

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Manfred Spraul <manfred(at)colorfullife(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: performance: use pread instead of lseek+read
Date: 2003-02-24 21:03:58
Message-ID: 5494.1046120638@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Manfred Spraul <manfred(at)colorfullife(dot)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

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Ross J. Reedstrom 2003-02-24 21:34:57 Re: Simplifying timezone support
Previous Message Peter Eisentraut 2003-02-24 19:16:07 Re: to_char PL/MI fix