Woeful performance of D compared to C++

Sean Kelly sean at f4.ca
Thu Jan 18 13:58:59 PST 2007


Bill Lear wrote:
> 
> The rand() call is definitely the most expensive.  When I remove it
> from both the C++ and the D program, the times plummet (to 0.003
> and 0.013 seconds, respectively --- still, however, leaving the D
> program running in 4.3 times that of the C++ program;-).

With execution times that short, you're really comparing the startup 
time of a D application vs. a C++ application.  And D application 
startup time includes the initialization of a garbage collector, in the 
default case.  If you really wanted to compare apples to apples here I'd 
rip out the default GC and replace it with one that has no 
initialization cost.



Sean



More information about the Digitalmars-d mailing list