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 23:41:23
Message-ID: 6248.1046130083@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:
> Tom Lane wrote:
>> 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.
>>
> It was considered expensive enough to write a syscall avoidance layer
> that caches the file pointer and skips lseek if fpos==offset.

You're missing the point: that layer is mostly there to ensure that we
don't foul up the kernel's readahead recognition for sequential fetches.
It's nice that Linux doesn't care, but Linux is not the only platform
we worry about.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Manfred Spraul 2003-02-25 06:35:13 Re: performance: use pread instead of lseek+read
Previous Message Manfred Spraul 2003-02-24 21:52:30 Re: performance: use pread instead of lseek+read