More radical ideas about gc and reference counting

Wyatt via Digitalmars-d digitalmars-d at puremagic.com
Fri May 9 14:05:17 PDT 2014


On Friday, 9 May 2014 at 16:12:00 UTC, Manu via Digitalmars-d 
wrote:
>
> Let's also bear in mind that Java's GC is worlds ahead of D's.
>
Is Sun/Oracle reference implementation actually any good?

> I am getting very tired of repeating myself and having my points
> basically ignored, or dismissed with something like "my project
> which doesn't actually share those requirements works fine" (not
> that I'm saying you did that just now; I don't know, you need to
> tell me more about your project).  I'd really like to establish
> as fact or fiction whether tracing GC is _practically_
> incompatible with competitive embedded/realtime environments
> where pushing the hardware to the limits is a [requirement].
>
I've actually become very curious about this, too.  I know that 
our GC isn't good, but I've seen a lot of handwaving.  The 
pattern lately has involved someone talking about ARC being 
insufficient, leading somehow to Manu asserting sufficient GC is 
impossible (why?), and everyone kind of ignoring it after that.

I've been digging into research on the subject while I wait for 
test scripts to run, and my gut feeling is it's definitely 
possible to get GC at least into striking distance, but I'm not 
nearly an expert on this area.

(Some of these are dead clever, though! I just read this one 
today: 
https://research.microsoft.com/en-us/um/people/simonpj/papers/parallel/local-gc.pdf)

> I don't know how to reconcile the problem with the existing GC,
> and I am not happy to sacrifice large parts of the language for
> it.  I've made the argument before that sacrificing large parts
> of the language as a 'work-around' is, in essence, sacrificing
> practically all libraries. That is a truly absurd notion; to
> suggest that anybody should take advice to sacrifice access to
> libraries is being unrealistic.
>
This is important, and simply throwing up our collective hands 
and saying to just not use major language features (I believe I 
recall slices were in that list?) really doesn't sit well with me 
either.

But conversely, Manu, something has been bothering me: aren't you 
restricted from using most libraries anyway, even in C++?  
"Decent" or "acceptable" performance isn't anywhere near 
"maximum", so shouldn't any library code that allocates in any 
language be equally suspect?  So from that standpoint, isn't any 
library you use in any language going to _also_ be tuned for 
performance in the hot path?  Maybe I'm barking up the wrong 
tree, but I don't recall seeing this point addressed.

More generally, I feel like we're collectively missing some 
important context:  What are you _doing_ in your 16.6ms 
timeslice?  I know _I'd_ appreciate a real example of what you're 
dealing with without any hyperbole.  What actually _must_ be done 
in that timeframe?  Why must collection run inside that window?  
What must be collected when it runs in that situation?  (Serious 
questions.)

See, in the final-by-default discussions, you clearly explained 
the issues and related them well to concerns that are felt 
broadly, but this... yeah, I don't really have any context for 
this, when D would already be much faster than the thirty years 
of C navel lint (K&R flavour!) that I grapple in my day job.

-Wyatt


More information about the Digitalmars-d mailing list