On Mon, Nov 10, 2003 at 07:26:03PM +0100, Miklos Szeredi wrote:
> This is a nice feature. But I think it would be better if it was
> implemented with writev, since then you wouldn't need to keep track of
> the request state. I think a writev implemetation could be quite
> simple if there was a limitation that the header and the args must be
> atomic (as is now the case if I understand your patch correctly).
Thanks for you suggestion.
Upon further experimentation it does appear that you are right.
Originally I did not use writev, because I thought that it used normal write
to do the work. Now I realize that that would not make sense, because the
main point of writev is to avoid the overhead of multiple system calls to
write several buffers.
Then I thought it would be slower, because it does have to do a memcpy
somewhere along the way in order to be able to present the two buffers as a
single continuous blob. But my benchmarking shows that writev is somehow a
bit faster anyway! I guess the difference is offset by not having the second
Perhaps it could still be useful to somebody if they were doing something
esoteric, like using sendfile(2), or something, but writev works nicely for
me, so I withdraw my patch.
Have fun, I tried to no avail
Michael "mag" Grigoriev To keep my eyes from growing pale
mag@... But my vision came too late
http://www.luminal.org And my belief started to abate