Re: file rawRead and rawWrite in chunks example

2015-08-09 Thread Jay Norwood via Digitalmars-d-learn
On Sunday, 9 August 2015 at 10:40:06 UTC, Nordlöw wrote: On Sunday, 9 August 2015 at 00:50:16 UTC, Ali Çehreli wrote: Ali Now benchmarks write and read separately: I benchmarked my first results: D:\visd\raw\raw\Release>raw time write msecs:457 time read msecs:75 This is for 160MB of data

Re: file rawRead and rawWrite in chunks example

2015-08-09 Thread Jay Norwood via Digitalmars-d-learn
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 su

Re: file rawRead and rawWrite in chunks example

2015-08-09 Thread Nordlöw
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 ther

Re: file rawRead and rawWrite in chunks example

2015-08-09 Thread Nordlöw
On Sunday, 9 August 2015 at 00:50:16 UTC, Ali Çehreli wrote: Ali Now benchmarks write and read separately: https://github.com/nordlow/justd/blob/0d746b2c1800a82a61a6cb7edcabfd9664066b2c/tests/t_rawio.d Couldn't the chunk logic be deduced aswell? Something like: void rawWriteInAutoChunks(R)(F

Re: file rawRead and rawWrite in chunks example

2015-08-08 Thread Ali Çehreli via Digitalmars-d-learn
On 08/08/2015 07:07 PM, Jay Norwood wrote: > On Sunday, 9 August 2015 at 00:50:16 UTC, Ali Çehreli wrote: >> // NOTE: No need to tell rawRead the type as double >> iota(10, 20_000_000 + 10, n) >> .each!(a => f.rawRead(dbv)); >> } >> >> Ali > > Your f.rawRead(dbv) f

Re: file rawRead and rawWrite in chunks example

2015-08-08 Thread Jay Norwood via Digitalmars-d-learn
On Sunday, 9 August 2015 at 00:50:16 UTC, Ali Çehreli wrote: // NOTE: No need to tell rawRead the type as double iota(10, 20_000_000 + 10, n) .each!(a => f.rawRead(dbv)); } Ali Your f.rawRead(dbv) form compiles, but f.rawRead!(dbv) results in an error msg in c

Re: file rawRead and rawWrite in chunks example

2015-08-08 Thread Jay Norwood via Digitalmars-d-learn
On Sunday, 9 August 2015 at 00:50:16 UTC, Ali Çehreli wrote: { auto f = File(fn,"wb"); iota(10.5, 20_000_010.5, 1.0) .chunks(100) .each!(a => f.rawWrite(a.array)); } Ali Thanks. There are many examples of numeric to string data output in t

Re: file rawRead and rawWrite in chunks example

2015-08-08 Thread Ali Çehreli via Digitalmars-d-learn
On 08/08/2015 04:11 PM, Jay Norwood wrote: I'm playing around with the range based operations and with raw file io. I couldn't figure out a way to get rid of the outer foreach loops. When the body of the foreach loop performs something, then std.algorithm.each can be useful: import std.algo