[More Info] Increasing speed of D applications to Intel C compiled applicaitons' standards

Dave Dave_member at pathlink.com
Fri Nov 10 14:57:53 PST 2006


J Duncan wrote:
> %u wrote:
>> "Do you have any observations about what shorts of things put you
>> in the 20% category?"
>>
>> - Luckly the code requiring sheer processing power like math
>> functions(trigs, logs...), b-tree creation, compression, D code
>> runs only 5-6% slower (an averaged mean) compared to Intel C
>> compiler.

IMO, that's not real discouraging considering that Intel C/++/Fortran seems to be considered 'the 
best' for Intel platforms <g>

FWIW - DMD (the compiler, not the language) often lags by a good margin in two major areas that I 
wish would be improved: floating point calculations and recursion. The D FP spec. doesn't have the 
same maximum precision prohibitions as the C/++ spec. so it can be more heavily optimized and still 
follow the spec. DMD doesn't currently take advantage of that though.

>> - Unfortunately, processes requiring sheer memory access like
>> memcopy, mem alloc, de-alloc, stream copy is nearly almost 15->20%
>> slower at D. (note that, code is totally identical).
>>

D uses the DMC lib. for most of that stuff so the difference could be there.

Could it be that Intel is doing whole program optimization to inline things like memcpy and memset, 
during linkage (Are you using WPO? -- it may be the default, I can't remember)? I've found that for 
time critical code I can code my own (e.g.: memset) in D so the compiler can inline it and it will 
be faster. Perhaps those should be in Phobos instead of the C lib.?

>> I'll post these results on my blog once I put them into a good

I didn't see a url for your blog?

>> graphed format so we can discuss it even further. with my limited
>> knowledge on compilers, what i've seen is that intel c compiler
>> has many ingenious optimisations. maybe there can be a way to put
>> the same ideas into D compiler. (i hope)
> 
> 
> so are we talking about a GC issue? I think it would be interesting to 
> use D for a front end to C . Then basically D code could be ran through 
> the Intel optimizer.



More information about the Digitalmars-d mailing list