Currently a static sized buffer is used for reading files. At the moment
it is extremely small, making parsing of large files extremely slow.
Increase this to 4k for improved performance. This also allows reading
files like /dev/kmsg on Linux, which will error if the read buffer is
too small.

Signed-off-by: Jason A. Donenfeld <ja...@zx2c4.com>
---
 lib/sh/zread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/sh/zread.c b/lib/sh/zread.c
index 8dd78102..f1389887 100644
--- a/lib/sh/zread.c
+++ b/lib/sh/zread.c
@@ -117,7 +117,7 @@ zreadintr (fd, buf, len)
    in read(2).  This does some local buffering to avoid many one-character
    calls to read(2), like those the `read' builtin performs. */
 
-static char lbuf[128];
+static char lbuf[4096];
 static size_t lind, lused;
 
 ssize_t
-- 
2.27.0


Reply via email to