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 file"); > File file = File("test.txt", "w"); > > for (int i = 0; i < 50000000; i++) > { > file.write("\x00"); > } > file.close(); > > } > > > While GNU coreutils dd can create 500mb dummy Nul file in a > second. > https://github.com/coreutils/coreutils/blob/master/src/dd.c > > What are the explanations for this? > https://matthias-endler.de/2017/yes/