C faults, etc

bearophile bearophileHUGS at lycos.com
Mon Jul 20 10:48:02 PDT 2009


Lutger:
> writefln does a flush where writef doesn't. On my system (fedora 11) all 
> timings are nearly the same however, while writef is actually a bit faster 
> than printf. What OS are you on?

I am doing such tests on an unloaded Windows 32 bit XP SP2, on a Core2 at 2 GHz and 2 GB RAM.

I have done another test for writeln, and indeed it's quite faster than writefln, it takes 2.45 seconds:

import std.stdio: writeln;
void main() {
    const int N = 2_000_000;
    for (int i; i < N; i++)
        writeln("test ", i);
}

Bye,
bearophile



More information about the Digitalmars-d mailing list