bearophile wrote: > Trass3r: > >> I ported smallpt to D some time ago and now that I've working versions of >> LDC2 and GDC2 I did a quick comparison: > > I have converted to D many of the commonly found benchmarks, this is my > version: http://codepad.org/ZbmSfseY > > If I compile it with with LDC1 with Link Time Optimization + Interning: > ldc -O3 -release -inline -output-bc smallpt2_d.d > > opt -std-compile-opts smallpt2_d.bc > smallpt2_do.bc > > llvm-ld -native -ltango-base-ldc -ltango-user-ldc -ldl -lm -lpthread > -internalize-public-api-list=_Dmain -o=smallpt2_do smallpt2_do.bc > > I produce a binary that's faster than the C++ version (22.7 seconds > instead of 29 seconds).
bearophile, just out of interest, what's the performance like if you ran ldmd -O3 -release -inline smallpt2_d.d ? If everything worked right -std- compile-opts should do the same that LDC does at -O3. And why would internalizing _Dmain have a noticable performance impact?
