WordCount performance
Saaa
empty at needmail.com
Thu Mar 27 02:32:27 PDT 2008
>> What if you can't do b nor have the time to learn b and see that another
>> compiler(language) runs faster without the need of b?
> Because the insight gained by figuring out why one is faster than the
> other will be very valuable to you in future projects. I know a lot of
> programmers who made mistaken assumptions about why one program was faster
> than another, assumptions that eventually wound up costing them dearly.
I don't really see how this is an answer to my question.
I suspect this is a more general post about language benchmarks :)
>
> A sampling:
>
> 1) used the wrong compiler switches
>
> 2) the 'faster' program was faster because it had a disastrous bug in it
>
> 3) thought that their benchmark was measuring loop performance, when it
> was actually measuring the time spent in printf or malloc, rendering all
> their conclusions about how to write fast loops false.
>
> 4) thought they'd discovered a unique fast algorithm, when what was
> actually happening was the compiler optimizer had figured out how to
> eliminate a redundant DIV instruction
>
> 5) the benchmark proving that language A runs faster than language B
> turned out to be a result peculiar to that particular benchmark, and on
> the real program the reverse was true
>
> So, essentially, if you don't know *why* the benchmark produced the
> results it did, you don't have enough information to draw any conclusions
> about the language.
The first steps taken on this newsgroup regarding benchmarks(program speed)
are generally (as should be) 1, 2 and 3.
4 is sort of what I was talking about: I would like the D compiler to match
the
optimization level of (the gcc or even intel:) C compiler.
I am not sure whether you meant to say the opposite of this but:
You don't need to understand asm to rule out 1,2 and 3; and know that the
speed
difference lies within 4 (compiler optimizations).
More information about the Digitalmars-d
mailing list