Encouraging preliminary results implementing memcpy in D

Fra Mecca me at francescomecca.eu
Wed Jun 13 12:45:26 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 get this on Linux 4.16.3-gentoo, AMD FX(tm)-6100 Six-Core 
Processor, 8GiB ram,

using ldc2 -O3L:
size memcpyC memcpyD
1 5 0
2 0 0
4 0 0
8 0 0
16 1519 0
32 1833 0
64 3816 0
128 7543 0
256 146500 0
512 194818 0
1024 329593 846142
2048 714945 1117132
4096 1596170 1803621
8192 5899818 6110026
16384 12338384 14141850
32768 24971315 26771484
65536 49806637 63260128

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
core.exception.AssertError at memcpyd.d(9): Assertion failure
----------------
??:? _d_assert [0xcaf056d5]
??:? [0xa015e7fe]
??:? [0xa0158cb0]
??:? void rt.dmain2._d_run_main(int, char**, extern (C) int 
function(char[][])*).runAll() [0xcaf29daf]
??:? _d_run_main [0xcaf29c7b]
??:? __libc_start_main [0xca160eeb]
??:? [0xa0158b29]



More information about the Digitalmars-d-announce mailing list