On Sunday, 9 August 2015 at 11:06:34 UTC, Nordlöw wrote:
On Sunday, 9 August 2015 at 10:40:06 UTC, Nordlöw wrote:
Couldn't the chunk logic be deduced aswell?

Yes :)

See update at:

https://github.com/nordlow/justd/blob/a633b52876388921ec49c189f374746f7b4d8c93/tests/t_rawio.d

What would a suitable value for `preferred_disk_write_size` be?

Is there a suitable constant somewhere in Phobos?

So, to be clear, I think you must be saying that you want to specify the disk chunk size separate from the array size. Is that correct?

I stepped through the original code (with the foreach loops) and I see single calls to fwrite and fread for each array.

The rawWrite is executing a single fwrite per array
f.rawWrite(elem.array())

        auto result =
.fwrite(buffer.ptr, T.sizeof, buffer.length, _p.handle);

The rawRead is executing a sing fread per array
        immutable result =
            fread(buffer.ptr, T.sizeof, buffer.length, _p.handle);


Reply via email to