Encouraging preliminary results implementing memcpy in D

Uknown sireeshkodali1 at gmail.com
Wed Jun 13 14:34:28 UTC 2018


On Wednesday, 13 June 2018 at 06:46:43 UTC, Mike Franklin wrote:
> I had a little fun today kicking the crap out of C's memcpy 
> with a D implementation.
>
> https://github.com/JinShil/memcpyD
>
> Request for help: I don't have a Linux system running on real 
> hardware at this time, nor do I have a wide range of platforms 
> and machines to test with.  If you'd like to help me with this 
> potentially foolish endeavor, please run the program on your 
> hardware and send me the results.
>
> Feedback, advise, and pull requests to improve the 
> implementation are most welcome.
>
> Mike

I'm glad to see this kind of improvement! I noticed there wasn't 
any macOS testing though, so heres the results on my machine:

size memcpyC memcpyD
1 38613 5185
2 42475 7259
4 54272 3450
8 29391 3457
16 32947 3626
32 33761 7253
64 44152 14510
128 51985 27711
256 65700 58044
512 95315 119977
1024 150726 387021
2048 265975 667858
4096 521565 1113945
8192 965322 2039064
16384 3923818 3997524
32768 15586237 15669232
65536 33195890 31640205

size memcpyC memcpyD
1 40057 5180
1 36664 5226
1 37625 5280
2 36584 5178
2 36956 5252
4 51086 3448
4 49952 3456
8 29497 3455
8 29710 3987
4 51539 3453
8 29715 3449
16 29747 23535

sys info : Intel Core i5 4258u (28w), 8GB DDR3 1600MHz RAM

Looks very promising. One question though, why not use 
std.datetime.stopwatch.benchmark? I think it has some protection 
against optimizing compilers (I may be wrong though). Also, LDC 
has attributes to control optimizations on a per function 
basis.see : https://wiki.dlang.org/LDC-specific_language_changes

My linux install got messed up, but I'll post benchmarks as soon 
as its up


More information about the Digitalmars-d-announce mailing list