On 11/10/2016 10:12 AM, Martin Lundgren wrote:
I've been reading up a bit on the D garbage collector. Seen mostly
negative things about it. I've also seen a lot of proposals and what
not, but not much about the current state of things.
The latest page I can find about it is 2015H1. It mentions improving the
GC and making libraries less reliant on it. However, I can't find *any*
information about what GC improvements have been made. No up to date
performance comparisons, etc.
So what's been happening in memory management land lately? Bad GC seems
like one of the Dlangs weak points, so showing improvements here could
definitely bring more people in.
Well I can't say what has happened since that half way document.
Most of the work that goes on is minor tweaks and improvements that
pretty much nobody outside of druntime knows about and that is quite all
right.
If you want to actually see all these things going on check out Github[0].
Anyway, most of the time the GC isn't a problem, contrary to popular
belief. As long as you do tricks like reusing memory it will never fire
and more importantly you won't be hit with memory allocation costs. So
basically a double win for you in terms of speed.
When dealing with multi threading you probably want to disable the GC
collection and have predefined points so it can collect safely with no
performance hits.
In reality, except for some cycle counting points, you won't need a
million dollar GC and even then they tend to fail at those sort of jobs.
[0]
https://github.com/dlang/druntime/tree/2db828bd4f21807254b770b3ec304f14596a9805/src/gc