Why is D slower than LuaJIT?

Lutger Blijdestijn lutger.blijdestijn at gmail.com
Wed Dec 22 23:56:37 PST 2010


Andreas Mayer wrote:

> Walter Bright Wrote:
> 
>> I notice you are using doubles in D. dmd currently uses the x87 to
>> evaluate doubles, and on some processors the x87 is slow relative to
>> using the XMM instructions. Also, dmd's back end doesn't align the
>> doubles on 16 byte boundaries, which can also slow down the floating
>> point on some processors.
> 
> Using long instead of double, it is still slower than LuaJIT (223 ms on my
> machine). Even with int it still takes 101 ms and is at least 3x slower
> than LuaJIT.
> 
>> Both of these code gen issues with dmd are well known, and I'd like to
>> solve them after we address higher priority issues.
>> 
>> If it's not clear, I'd like to emphasize that these are compiler issues,
>> not D language issues.
> 
> I shouldn't use D now? How long until it is ready?

You may want to explore the great language shootout before drawing that 
conclusion:

http://shootout.alioth.debian.org/

LuaJit ranks high there, but still a bit below the fastest compiled 
languages (and the fastest java). D is not included anymore, but it once was 
and these benchmarks can still be found:

http://shootout.alioth.debian.org/debian/performance.php

LuaJit performance is impressive, far above any 'scripting' language. Just 
look at some numbers in the shootout comparing it to ruby or python.





More information about the Digitalmars-d mailing list