memcpy vs slice copy

Moritz Warning moritzwarning at web.de
Sun Mar 15 06:17:50 PDT 2009


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

I don't see a very big difference between slice copying and memcpy (but 
between compilers).



Btw.: http://www.digitalmars.com/pnews/read.php?
server=news.digitalmars.com&group=digitalmars.D.bugs&artnum=14933



More information about the Digitalmars-d mailing list