From: Eric Wong Date: Wed, 6 Apr 2016 02:41:53 +0000 (+0000) Subject: repobrowse: larger, short-lived buffer for reading patches X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aea422e86f56c952813882b5a2836cca0fe4c0a8;p=thirdparty%2Fpublic-inbox.git repobrowse: larger, short-lived buffer for reading patches Since we do not parse the patch output, we can use a bigger buffer and localize it to the block for memory savings if xdiff generation takes a long time. --- diff --git a/lib/PublicInbox/RepobrowseGitPatch.pm b/lib/PublicInbox/RepobrowseGitPatch.pm index b3cf17fe6..a6c5aad89 100644 --- a/lib/PublicInbox/RepobrowseGitPatch.pm +++ b/lib/PublicInbox/RepobrowseGitPatch.pm @@ -29,7 +29,7 @@ sub call_git_patch { my $rpipe = $git->popen(@cmd); my $env = $req->{cgi}->env; my $err = $env->{'psgi.errors'}; - my ($buf, $n, $res, $vin, $fh); + my ($n, $res, $vin, $fh); my $end = sub { if ($fh) { $fh->close; @@ -53,7 +53,7 @@ sub call_git_patch { $err->print("git format-patch ($git->{git_dir}): $e\n"); }; my $cb = sub { - $n = $rpipe->sysread($buf, 8192); + $n = $rpipe->sysread(my $buf, 65536); return $fail->() unless defined $n; return $end->() if $n == 0; if ($res) {