mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:57:44 +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:
parent
94a6b248ca
commit
73b2cb9ed8
1 changed files with 1 additions and 1 deletions
|
@ -95,7 +95,7 @@ bool copy_file(String src_path, String dst_path, struct stat src_stat, int src_f
|
||||||
}
|
}
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
char buffer[BUFSIZ];
|
char buffer[32768];
|
||||||
ssize_t nread = read(src_fd, buffer, sizeof(buffer));
|
ssize_t nread = read(src_fd, buffer, sizeof(buffer));
|
||||||
if (nread < 0) {
|
if (nread < 0) {
|
||||||
perror("read src");
|
perror("read src");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue