From ddd83320156e7bff5703a00b63d11d812c2ed891 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 3 Nov 2019 00:09:17 +0100 Subject: [PATCH] cat: Use a 32 KB I/O buffer here to improve "cat a > b" scenario This is roughly twice as fast as the old 4 KB buffer size. We still don't go nearly as fast as "cp", since we don't ftruncate() up front like "cp" does. --- Userland/cat.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/cat.cpp b/Userland/cat.cpp index b3500686025..0e8110fdabe 100644 --- a/Userland/cat.cpp +++ b/Userland/cat.cpp @@ -24,7 +24,7 @@ int main(int argc, char** argv) } for (auto& fd : fds) { for (;;) { - char buf[4096]; + char buf[32768]; ssize_t nread = read(fd, buf, sizeof(buf)); if (nread == 0) break;