From: Eric Wong Date: Sat, 5 Mar 2016 00:24:16 +0000 (+0000) Subject: git-http-backend: favor sysread for regular files X-Git-Tag: v1.0.0~653 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=310819ea86ac7f85d39a2a8720c4d179c8c94277;p=public-inbox.git git-http-backend: favor sysread for regular files We do not need line buffering, here; so favor sysread to bypass extra copies which may be done by normal read. --- diff --git a/lib/PublicInbox/GitHTTPBackend.pm b/lib/PublicInbox/GitHTTPBackend.pm index c84eefcf..50bb4331 100644 --- a/lib/PublicInbox/GitHTTPBackend.pm +++ b/lib/PublicInbox/GitHTTPBackend.pm @@ -73,7 +73,7 @@ sub serve { my $n = 8192; while ($len > 0) { $n = $len if $len < $n; - my $r = read($in, $buf, $n); + my $r = sysread($in, $buf, $n); last if (!defined($r) || $r <= 0); $len -= $r; $fh->write($buf);