SmartRef: The Smart Pointer In D

Chris Wright via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Sat Jan 14 06:54:24 PST 2017


On Sat, 14 Jan 2017 11:52:34 +0000, nbro wrote:
> Garbage collection in D is more expensive just because of the poor
> implementation, from what I've heard. If that's the case, people who
> work on it should be able to improve it over time.

I posted about this in general.

A GC for Java, Python, Ruby, etc can locate type information and GC 
metadata for an allocation in O(1) time. D's can locate type information 
and GC metadata in O(log N) time in the worst case, even with the best 
possible implementation, and its design decisions make the worst case 
incredibly common. That is one of the common operations that a GC does, 
so it has a big performance impact.

D's GC must be slower because it allows pointers to arbitrary places 
inside an allocation, and it strongly encourages this with array slicing.


More information about the Digitalmars-d-announce mailing list