[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Objective-C and Smalltalk; speed of message send

From: Travis Griggs
Subject: Re: Objective-C and Smalltalk; speed of message send
Date: Thu, 19 Aug 2004 23:53:14 -0700

On Aug 19, 2004, at 14:31, Stefan Urbanek wrote:

On 2004-08-19 18:23:33 +0200 Leigh Smith <address@hidden> wrote:


> I'm surprised that automatic garbage collection would be found (or perhaps is
> just assumed?) to be faster than reference counting.

Do you have any comparisons or pointers to some already done? It can be quite interesting.

The most enlightening text I've read on the subject is Jones and Lins "Garbage Collection". It is one of the few text books I have actually ever read front to back. I thought it was well written and very engaging. IMO, anyone who's seriously interested in this GC thing, oughta have it.

Reference counting offers the promise of amortizing the cost of reclamation over the life cycles of objects. The problem is, that in reality it is actually often lumpy and not as deterministic as the "I'm using ref-counting because my program is real-time" programmer might think. Reference counting is the easiest and simplest to implement. It suffers from a) having to store a counter per object b) counter overflow scenarios c) can't deal with cycles. It is also the most intrusive on the architecture of the client program. IOW, the mutator (program) ends up very intertwined with the GC mechanism.

> More importantly, it's possible to read the code and understand what the hell > is going on! Good design is the key (and reference counting does not really > compromise that design, in my experience) and the dynamic OO of ObjC aids > that design process. Ditto Smalltalk, I certainly wouldn't mind GC, but for > real-time work I'd want some control over it, perhaps just hinting impending > reuse. Having looked at the audio code of Squeak (not recently), the higher > level design is great, but then the connection to the C means big design
> compromises which miss the opportunity to propagate future design
> optimisations.

Is it possible to use several GC techniques in a single application? Or use something like GC zones with different GC methods, where one can use ref.counting or suspend collection for time critical parts of threads.

How would one deal with cross zone references? Or would those be disallowed?

Travis Griggs
One man's blue plane is another man's pink plane.

DISCLAIMER: This email is bound by the terms and conditions described at

reply via email to

[Prev in Thread] Current Thread [Next in Thread]