1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 16:24:02 +00:00

Increase the buffer size used in tr_moveFile (#933)

In some filesystems, including ones mounted on a network drive, using a small buffer size 
significantly hurts copy performance. Upping the buffer to 1024kb to increase copy performance.
This commit is contained in:
Tom Forbes 2019-11-06 15:46:13 +00:00 committed by Charles Kerr
parent 2ef07517b6
commit 8d7fbb5d45

View file

@ -1686,7 +1686,7 @@ bool tr_moveFile(char const* oldpath, char const* newpath, tr_error** error)
char* buf = NULL; char* buf = NULL;
tr_sys_path_info info; tr_sys_path_info info;
uint64_t bytesLeft; uint64_t bytesLeft;
size_t const buflen = 1024 * 128; /* 128 KiB buffer */ size_t const buflen = 1024 * 1024; /* 1024 KiB buffer */
/* make sure the old file exists */ /* make sure the old file exists */
if (!tr_sys_path_get_info(oldpath, 0, &info, error)) if (!tr_sys_path_get_info(oldpath, 0, &info, error))