What are the best available D (not C) File input/output options?
Sergey
kornburn at yandex.ru
Thu Nov 2 19:59:51 UTC 2023
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
More information about the Digitalmars-d-learn
mailing list