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:
parent
55cd860ea3
commit
7c2fd87308
|
@ -399,7 +399,7 @@ log("trigger event");
|
||||||
if (bytes.length == 0) safeAtomicStore(f.ioStatus, IOStatus.ok);
|
if (bytes.length == 0) safeAtomicStore(f.ioStatus, IOStatus.ok);
|
||||||
|
|
||||||
while (bytes.length > 0) {
|
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); } ();
|
auto ret = () @trusted { return mixin("."~op)(cast(int)file, bytes.ptr, cast(uint)sz); } ();
|
||||||
if (ret != sz) {
|
if (ret != sz) {
|
||||||
safeAtomicStore(f.ioStatus, IOStatus.error);
|
safeAtomicStore(f.ioStatus, IOStatus.error);
|
||||||
|
|
Loading…
Reference in a new issue