Thread overview
Status of getting CDGC into druntime
Jun 02, 2014
Joakim
Jun 02, 2014
Dicebot
Jun 02, 2014
Sean Kelly
Aug 05, 2014
Darren
Aug 05, 2014
Dicebot
June 02, 2014
I just stumbled across this year-old blog post on the Sociomantic blog, mentioning plans to get CDGC into druntime:

https://www.sociomantic.com/blog/2013/06/porting-cdgc-to-d2/

A google search turned up this forum thread also:

http://forum.dlang.org/thread/20130529162043.GA5161@sociomantic.com

and I notice that Luca made some commits back then:

https://github.com/D-Programming-Language/druntime/commits?author=leandro-lucarella-sociomantic

Obviously, the work has since been sidelined, but can we get an update on whether you still plan to merge it and when?  Thanks.
June 02, 2014
On Monday, 2 June 2014 at 12:01:21 UTC, Joakim wrote:
> I just stumbled across this year-old blog post on the Sociomantic blog, mentioning plans to get CDGC into druntime:
>
> https://www.sociomantic.com/blog/2013/06/porting-cdgc-to-d2/
>
> A google search turned up this forum thread also:
>
> http://forum.dlang.org/thread/20130529162043.GA5161@sociomantic.com
>
> and I notice that Luca made some commits back then:
>
> https://github.com/D-Programming-Language/druntime/commits?author=leandro-lucarella-sociomantic
>
> Obviously, the work has since been sidelined, but can we get an update on whether you still plan to merge it and when?  Thanks.

There is nothing to merge right now, porting has not been completed.
June 02, 2014
On Monday, 2 June 2014 at 12:13:34 UTC, Dicebot wrote:
>
> There is nothing to merge right now, porting has not been completed.

To be fair, I had CDGC running on D2 almost 4 years ago:

https://github.com/D-Programming-Language/druntime/tree/CDGC

But the D2 GC has been updated a lot since CDGC was created, and
someone needs to review those changes and figure out what changes
need to be made to CDGC to make it current.  That might be as
simple as adding a few more flags, but it's possible that other
fixes happened that should be applied to CDGC as well.

What I did at the time I created the CDGC branch was diff our GC
now vs. the code from when Druntime was created (the SVN repo on
dsource.org).  It shouldn't be more than a bunch of busywork for
someone to figure out which changes are relevant and apply them,
but it's busywork no one has wanted to do yet.
August 05, 2014
On Monday, 2 June 2014 at 19:04:05 UTC, Sean Kelly wrote:
>
> What I did at the time I created the CDGC branch was diff our GC
> now vs. the code from when Druntime was created (the SVN repo on
> dsource.org).  It shouldn't be more than a bunch of busywork for
> someone to figure out which changes are relevant and apply them,
> but it's busywork no one has wanted to do yet.

I think the plan was to incrementally evolve the GC towards the CDGC. Probably the 'right' thing to do but it requires more patience (and a deeper understanding of the GC code). Judging by the commit history the effort does appear to have slowed down. Perhaps there's activity taking place that's not visible on github.

I'm personally really interested in the progress of this effort - in particular removing the global lock on allocations. My primary experience is with Java, which is far more profligate with object allocation than D, but single-threaded object allocation was one of the biggest performance killers for certain types of application. We had 4-cpu servers (back when that was a lot) with 1 red-hot processor and 3 idle ones due to contention on memory allocation.

I'd also like to echo Leandro regarding configurable GC. There is no one-size-fits-all for applications. Interactive applications favour low-latency over throughput, while a long-running batch process wants throughput and doesn't care so much about long pauses. Being able to tune Java's GC at runtime allowed me to turn a 90 minute batch process into 12 minutes with zero code changes. A real lifesaver.
August 05, 2014
Oh, thanks for reminding me about this thread :)

I have been working on CDGC porting for some time. Currently I have a basic version that can be built within D2 druntime and is capable of allocating and cleaning the garbage. It still needs some cleanup and tests do not pass because of different runtime requirements compared to D1 but I expect to present something for public experiments this autumn.

(thanks Sean Kelly for earlier similar effort and Martin Nowak for explaining how to do forks properly :P)