Dean:

I need a little helping hand with dmd on a 32 bit Debian box. I
installed dmd from http://d-apt.sourceforge.net/

i) First trial:

====================
$cat test.d

import std.stdio;
void main() {
   writeln("hello");
}

$ time dmd test.d

real    0m2.355s
user    0m1.652s
sys     0m0.364s

$./test
hello

$ dmd -v test.d | wc -l
84
====================

Seems to be working. My only concern is whether 2.35s for
compiling such a trivial file is normal.

On a Windows 32 bit that little program compiles in 0.74 seconds (warmed up time) using and old CPU. Modern CPUs should take about 0.5 seconds.

Keep in mind that writeln and std.stdio are lot of stuff. If you use C io functions:

void main() {
    import core.stdc.stdio;

    puts("hello");
}


This compiles in 0.18 seconds (warmed up time) on the same computer with dmd. The difference between 0.74 and 0.18 is more or less a constant if you use std.stdio.


I have also tried this C++ version:

#include <iostream>

int main() {
    std::cout << "hello" << std::endl;
    return 0;
}


With gcc 4.8.0 it takes me 0.48 seconds to compile (warmed up time).

Writeln manages unicode, and is quite more refined than iostream.

Bye,
bearophile

Reply via email to