memcpy vs slice copy

Moritz Warning moritzwarning at web.de
Sun Mar 15 07:22:37 PDT 2009


On Sun, 15 Mar 2009 13:17:50 +0000, Moritz Warning wrote:

> On Sat, 14 Mar 2009 23:50:58 -0400, bearophile wrote:
> 
>> While doing some string processing I've seen some unusual timings
>> compared to the C code, so I have written this to see the situation
>> better. When USE_MEMCPY is false this little benchmark runs about 3+
>> times slower:
> 
> I did a little benchmark:
> 
> ldc -release -O5
> true: 0.51
> false: 0.63
> 
> dmd -release -O
> true: 4.47
> false: 3.58

My system is 64bit with dmd 1.041 and ldc from trunk.
Since dmd produces 32bit binaries only this might account
for a factor of two for the timings.



More information about the Digitalmars-d mailing list