[GSoC] 'Independency of D from the C Standard Library' progress and update thread

Stefanos Baziotis sdi1600105 at di.uoa.gr
Sat Jul 20 09:53:57 UTC 2019


On Friday, 5 July 2019 at 11:02:00 UTC, Stefanos Baziotis wrote:
>
> I'm now moving to weekly updates. Before the updates of what I 
> did, let me update
> you on the state of the project.

Last 2 Weeks
============

I could not do weekly updates because unfortunately, there are a 
lot of things out of schedule in the project.

So basically, the last 2 weeks I improved memcpy() / memmove() so 
they can be PR'd to the druntime. This [1] was the first PR. It 
had to be moved into separate
PRs for memcpy() and memmove. Yesterday, an important question 
was answered which let me do a new PR for memcpy() [2]

Along with that, I created memcmp() replacement [3]. I'm 
relatively satisfied with how the code looks, but this can't be 
PR'd yet to the druntime due to performance
problems (more on that on the blockers).

Blockers
========

-- On memcmp:

That was my post on Slack:

There are 3 major problems:
1) The performance is really really bad. Assuming that I have not 
done something stupid, it's just really bad. And actually, the 
asm generated (from `LDC`) is really weird too.
2) I made a version of Agner Fog's `memcmp` (which incidentally 
is similar to mine, it just goes reverse and does some smart 
things in subtractions). The thing is:
    a) Mine and Agner's should be about the same but it's not 
(Agner's is way better).
    b) Agner's is still quite low compared to `libc`.
3) The `LDC` version gives some very weird results for `libc 
memcmp`. Meaning, in benchmarks. And actually, the -O3 ASM 
generated by LDC seems bad as well.

-- Τhe state of the project

Right now, there is no specific roadmap nor any specific goals 
moving forward.
The project was divided in 2 parts. One was the memcpy() et al. 
which included
memcpy(), memmove() and memcmp() and the second was the allocator.
The first part is mostly done. After discussions with Seb, we 
decided
that the second part is not really needed after the mimalloc() of 
Microsoft:
https://forum.dlang.org/thread/krsnngbaudausabfsqkn@forum.dlang.org

So, currently I don't know how to move forward. I asked on the 
druntime
whether I can help with anything and zombinedev and Nicholas 
Wilson proposed
refactorings on core.thread. Nicholas helped me to start with 
that, so this
is going to be the next thing I will do. But this is supposed to 
be quick.

If anyone has any proposal on what to do next, I'm glad to 
discuss.


[1] https://github.com/dlang/druntime/pull/2671
[2] https://github.com/dlang/druntime/pull/2687
[3] https://github.com/baziotis/Dmemutils/tree/master/Dmemcmp


More information about the Digitalmars-d mailing list