OT (partially): about promotion of integers

SomeDude lovelydear at mailmetrash.com
Thu Dec 13 13:28:51 PST 2012


On Thursday, 13 December 2012 at 01:51:27 UTC, Timon Gehr wrote:
>
> Certainly, you can argue that the faster version should be in a 
> prominent place in the standard library, but the fact that it 
> is not does not indicate a fundamental performance problem in 
> the Haskell language. Also, note that I am completely ignoring 
> what kind of code is idiomatic in both languages. Fast Haskell 
> code often looks similar to C code.
>
Well, you can write C code in D.
You can compare top performance for both languages, but the fact 
is, if you write Haskell code extensively, you aren't going to 
write it like C, so comparing idiomatic Haskell vs idiomatic D 
does make sense. And comparing programs using the standard 
libraries also makes sense because that's how languages are used. 
It probably doesn't make much sense in a microbenchmark, but in a 
larger program it certainly does. And if the standard library is 
twice as slow in implementation A than in implemention B, then 
most programs will feel *at least* twice as slow, and usually 
more, because if you call a function f that's twice as slow in A 
than in B from another function that's also twice as slow in A 
than in B, then the whole thing is 4 times slower.


More information about the Digitalmars-d mailing list