diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-11-02 16:38:06 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-11-02 16:39:26 +0100 |
commit | 73b2cb9ed81124e294337738a323c2f28b0b64ec (patch) | |
tree | b7c15e451e113b9cce951a80f6956179edd8b37c /Userland/cp.cpp | |
parent | 94a6b248ca502456f46d31ccf3a4ad7fdf38a2ad (diff) | |
download | serenity-73b2cb9ed81124e294337738a323c2f28b0b64ec.zip |
cp: Read/write 32 KB at a time to go faster :^)
This is a huge speed-up (3x) when copying large files. Ideally this
would be optimized by the kernel somehow, but we're not there yet.
Diffstat (limited to 'Userland/cp.cpp')
-rw-r--r-- | Userland/cp.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/cp.cpp b/Userland/cp.cpp index d2e12e0153..93e1db6cd3 100644 --- a/Userland/cp.cpp +++ b/Userland/cp.cpp @@ -95,7 +95,7 @@ bool copy_file(String src_path, String dst_path, struct stat src_stat, int src_f } for (;;) { - char buffer[BUFSIZ]; + char buffer[32768]; ssize_t nread = read(src_fd, buffer, sizeof(buffer)); if (nread < 0) { perror("read src"); |