HTTPFile: use IO.sysread for better performance
commit651eeeacec1e9c0d59652c3a0d90ee83ddea46a8
authorEric Wong <normalperson@yhbt.net>
Wed, 3 Sep 2008 22:36:25 +0000 (3 15:36 -0700)
committerEric Wong <normalperson@yhbt.net>
Tue, 9 Sep 2008 01:59:23 +0000 (8 18:59 -0700)
treed06831964f8ad862cbf13710e4b147840c329d25
parent4c1f1924271dc828bb5eb22461b2b02390b11f6f
HTTPFile: use IO.sysread for better performance

IO.sysread is more GC-friendly than IO.read because it does not
have to allocate additional userspace buffers.  Userspace read
buffering is redundant nowadays with modern kernels (especially
in Linux 2.6 and almost always a performance hit).

Additionally, use an underdocumented feature of both IO.sysread
and IO.read that allows it to reuse the existing buffer.
Further reducing garbage collector overhead for large files.
lib/mogilefs/httpfile.rb