WordCount performance

Frits van Bommel fvbommel at REMwOVExCAPSs.nl
Wed Mar 26 15:14:49 PDT 2008


bearophile wrote:
> To test it, I have used a 7.5 MB file of real text. The C version (compiled with MinGW 4.2.1) is ~7.8 times faster (0.43 s instead of 3.35 s) than that very simpler code compiled with DMD (1.028). If I use a named break in the D code (that OUTER), to avoid the goto, the running speed is essentially the same.
> On a 50 MB file of text the timings are 2.43 s and 20.74 s (C version 8.5+ times faster).

The first thing that comes to mind: "For the Nth time, someone thinks 
language X is 'faster' than language Y because of a comparison between 
compilers with completely different backends (and thus optimizers), even 
though there are pairs of compilers that use the same backend for either 
language."

Try comparing DMC vs. DMD, or GCC vs. GDC...



More information about the Digitalmars-d mailing list