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

Dave Dave_member at pathlink.com
Fri Nov 10 15:30:01 PST 2006


Sean Kelly wrote:
> Dave wrote:
>>
>> 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've been thinking about this as well.  These functions are possibly a 
> bit much for intrinsics, but it would be fairly trivial to write them in 
> native D or even assembler--would have to inspect the resulting compiled 
> code to see which was better.  The only problem offhand is that DMD does 
> not inline functions containing loops, nor does it inline functions 
> containing ASM blocks, so we'd probably be stuck with a function call 
> even with native D code.
> 

Good points - I'd forgotten about not inlining loops.. The way I've "inlined" things like memset() 
is to just write a foreach if needed.

> Sean



More information about the Digitalmars-d mailing list