If I remove the writef statements, leaving just the number-crunching part, it runs in about 4s with gdmd, 7s with ldmd2 and 14s (!) with dmd.
From my experience, writef and friends are substantially slower than printf. I wouldn't recommend using them for output-intensive applications. And of course, the best option is to avoid any format string parsing altogether, using only fwrite calls.
