Encouraging preliminary results implementing memcpy in D

Diego diego at example.com
Thu Jun 14 11:38:57 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

Hello Mike,

These are my results:

Ubuntu 16.04.4 amd64 Linux 4.16.0-ck1+
Intel Xeon E5-2620 0 @ 2.00GHz - 12 cores
32 GB RAM

dmd -O -release memcpyd.d # dmd 2.080.0

size memcpyC memcpyD
1 125349 47658
2 155014 50492
4 173099 52669
8 228236 52676
16 107897 32621
32 128039 32604
64 163644 37658
128 223840 50420
256 338769 90300
512 584772 171038
1024 878093 995813
2048 1346958 1254141
4096 2439378 2101284
8192 5631202 3554307
16384 9873090 6496635
32768 22489302 21328288
65536 50522961 45748356

size memcpyC memcpyD
1 123241 27631
1 130758 28165
1 123247 32748
2 142964 27587
2 140914 28103
4 168084 32616
4 171166 27590
8 228274 27604
8 233249 27605
4 168624 27597
8 238049 29435
16 103956 52730

ldc2 -O3 -release memcpyd.d # ldc2 1.10.0-beta1

(I think these are strange results)

size memcpyC memcpyD
1 0 0
2 0 0
4 0 0
8 0 0
16 559 0
32 1003 0
64 0 0
128 0 0
256 0 0
512 0 0
1024 460182 1519048
2048 739148 1973641
4096 1533047 3168472
8192 2913463 5560106
16384 6385370 10353178
32768 20889322 21487968
65536 44920382 48339716

size memcpyC memcpyD
1 0 0
1 0 0
1 0 0
2 0 0
2 0 0
4 0 0
4 0 0
8 0 0
8 0 0
4 0 0
8 0 0
16 0 0



More information about the Digitalmars-d-announce mailing list