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.
This commit is contained in:
parent
be19606501
commit
ddd8332015
Notes:
sideshowbarker
2024-07-19 11:27:58 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ddd83320156
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue