Add async readahead buffer
This adds an async read buffer of 4x4MB when copying files >10MB. This fixes #164 and reduces the number of IO operations for copy/move.
This commit is contained in:
committed by
Nick Craig-Wood
parent
ab9f521cbd
commit
6344c3051c
@@ -198,6 +198,12 @@ tryAgain:
|
||||
ErrorLog(src, "Failed to open: %s", err)
|
||||
return
|
||||
}
|
||||
|
||||
// On big files add a buffer
|
||||
if src.Size() > 10<<20 {
|
||||
in0, _ = newAsyncReader(in0, 4, 4<<20)
|
||||
}
|
||||
|
||||
in := NewAccount(in0, src) // account the transfer
|
||||
|
||||
if doUpdate {
|
||||
|
||||
Reference in New Issue
Block a user