Increase I/O buffer size.

Uses a buffer size that is more reasonable for modern transfer speeds, while still providing enough granularity for cancellation. This heavily reduces the computational overhead on SSD drives.
This commit is contained in:
Sönke Ludwig 2021-01-12 14:23:30 +01:00
parent 55cd860ea3
commit 7c2fd87308

View file

@ -399,7 +399,7 @@ log("trigger event");
if (bytes.length == 0) safeAtomicStore(f.ioStatus, IOStatus.ok);
while (bytes.length > 0) {
auto sz = min(bytes.length, 4096);
auto sz = min(bytes.length, 512*1024);
auto ret = () @trusted { return mixin("."~op)(cast(int)file, bytes.ptr, cast(uint)sz); } ();
if (ret != sz) {
safeAtomicStore(f.ioStatus, IOStatus.error);