Hello everyone,
I just thought I would let people here know that ldc (llvm backend for the D Programming Language) is getting pretty usable (a few larger libraries compile) and it now has x86-64 support added. I decided to run some timings on some D and C++ code to compare ldc to dmd (the mainline compiler), gdc (the gcc based D compiler) and g++. I used a ray tracing program found in this thread (make sure to use the code mentioned later in the thread as it has some optimizations):
Go to digitalmars.com/ webnews/ newsgroups.php?renew=1 and search for: “D slower than C++ by a factor of two for simple raytracer (gdc)”
There are versions of the tracer for D and C++ that are quite comparable. Here are some timings I got on an AMDx86-64 running Fedora Core Linux. Timings are averaged over 6 runs.
llvm-g++4.0.1 5.76 (build 5449…backend from svn today)
ldc-rev736 6.68
g++4.1.2 6.72
gdc0.24 7.45
g++4.3.1 7.66
dmd1.030 14.52
As you can see D is NOT that much slower for the ray tracer, when using the proper compiler and options Dmd doesn’t optimize very well here.
I think LLVM performs quite admirably here and I am glad ldc uses it for a backend. The thread mentions the optimizations used for each compiler (ldc uses the same options as dmd).
Just thought I would let people know,
K.Wilson
P.S. I am not sure if this counts as another “supported language” for LLVM yet, but I think it is getting close.