Oh shit I forgot to redirect. That made my timings useless. This one is about 8x faster than writefln, flushing seems to be quite expensive: const int N = 2_000_000; for (int i; i < N; i++) writef("test %d\n", i);