
15 Jun
2011
15 Jun
'11
8:52 a.m.
On Wed, Jun 15, 2011 at 9:16 AM, Kazu Yamamoto
wouldn't the overhead of reading from the drive dominate the overhead of copying the contents from userspace to kernel space?
Probably yes at the first time. But I'm not sure after the file is cached.
If the file is in buffer cache, sendfile should be faster, it's zero-copy.
Re: sendfile, we solve this issue by making it impossible to issue a
sendfile() without sending either a file length or a byte range. Our
file serving code only calls stat() once, of course -- I agree with
Kazu, more than once I would probably consider a bug.
G
--
Gregory Collins