1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 03:08:13 +00:00

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.
This commit is contained in:
Andreas Kling 2019-11-02 16:38:06 +01:00
parent 94a6b248ca
commit 73b2cb9ed8

View file

@ -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");