]> Sergey Matveev's repositories - public-inbox.git/commitdiff
http: use a larger buffer for ->getline responses
authorEric Wong <e@80x24.org>
Sun, 24 Oct 2021 00:20:42 +0000 (18:20 -0600)
committerEric Wong <e@80x24.org>
Sun, 24 Oct 2021 02:20:33 +0000 (02:20 +0000)
64K matches the Linux pipe default, and matches what we use in
httpd/async and qspawn.  This should reduce syscalls used for
serving git packs via dumb HTTP and any ->getline code paths
used by other PSGI code.

This appears to speed up HTML rendering by w3m when serving
giant HTML responsees from the Devel::Mwrap::PSGI memory
debugger.

lib/PublicInbox/HTTP.pm

index 18a1925066fbdbfabbed6ac54b60982a08f85db7..e65988bedf06fe2c5236e333bd7fc075021168b4 100644 (file)
@@ -235,7 +235,7 @@ sub getline_pull {
        # limit our own running time for fairness with other
        # clients and to avoid buffering too much:
        my $buf = eval {
-               local $/ = \8192;
+               local $/ = \65536;
                $forward->getline;
        } if $forward;