On Thursday, 23 May 2019 at 18:37:17 UTC, H. S. Teoh wrote:
On Thu, May 23, 2019 at 06:20:23PM +, kdevel via
Digitalmars-d-learn wrote:
On Thursday, 23 May 2019 at 09:44:15 UTC, Cym13 wrote:
[...]
> To go fast, read/write bigger chunks.
Or use rawWrite instead of write (reduces the
On Thu, May 23, 2019 at 11:06 PM Daniel Kozak wrote:
> On Thu, May 23, 2019 at 11:10 AM BoQsc via Digitalmars-d-learn <
> digitalmars-d-learn@puremagic.com> wrote:
>
> https://matthias-endler.de/2017/yes/
>
So this should do it
void main()
{
import std.range : array, cycle, take;
On Thu, May 23, 2019 at 11:19 PM Daniel Kozak wrote:
Fixed version without decode to dchar
void main()
{
import std.range : array, cycle, take;
import std.stdio;
import std.utf;
immutable buf_size = 8192;
immutable buf = "\x00".byCodeUnit.cycle.take(buf_size).array;
auto
On Thu, May 23, 2019 at 11:10 AM BoQsc via Digitalmars-d-learn <
digitalmars-d-learn@puremagic.com> wrote:
> This code of D creates a dummy 47,6 MB text file filled with Nul
> characters in about 9 seconds
>
> import std.stdio, std.process;
>
> void main() {
>
> writeln("Creating a dummy
On Thu, May 23, 2019 at 06:20:23PM +, kdevel via Digitalmars-d-learn wrote:
> On Thursday, 23 May 2019 at 09:44:15 UTC, Cym13 wrote:
[...]
> > To go fast, read/write bigger chunks.
>
> Or use rawWrite instead of write (reduces the runtime to about 1.6 s).
> When using write time is IMHO spent
On Thursday, 23 May 2019 at 09:44:15 UTC, Cym13 wrote:
[...]
Note in particular the blocksize argument. I set it to 1M but
by default it's 512 bytes. If you use strace with the command
above you'll see a series of write() calls, each writting 1M of
null bytes to testfile. That's the main
On Thursday, 23 May 2019 at 09:09:05 UTC, BoQsc wrote:
This code of D creates a dummy 47,6 MB text file filled with
Nul characters in about 9 seconds
import std.stdio, std.process;
void main() {
writeln("Creating a dummy file");
File file = File("test.txt", "w");
for (int