On Thursday, 2 November 2023 at 15:46:23 UTC, confuzzled wrote:
I've ported a small script from C to D. The original C version
takes roughly 6.5 minutes to parse a 12G file while the port
originally took about 48 minutes.
In my experience I/O in D is quite slow.
But you can try to improve it:
Try to use std.outbuffer instead of writeln. And flush the result
only in the end.
Also check this article. It is showing how manual buffers in D
could speed up the processing of files significantly:
https://tech.nextroll.com/blog/data/2014/11/17/d-is-for-data-science.html