[squeak-dev] Metaclass allInstances

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Sat Nov 14 19:59:46 UTC 2009


I just performed some clean-up in pharo (
http://code.google.com/p/pharo/issues/detail?id=1444 ) and noticed
allInstancesDo: was implemented in Metaclass.

Obviously, this is an optimization for super, because super does work.
But I wonder if this optimization has any use at all

Generally, we should expect #allInstances and #allInstancesDo: to be
slow (iterate the whole image) and restrain from using it.
So, a sparse optimization for one case sounds strange to me... (there
is no optimization for other well known cases like True and False for
example).

Any hint on the existence of this specific optimization ?

PS: John McIntosh already noticed that #allInstances usage was a pain
for iphone, especially at image startup, one more reason to avoid it.



More information about the Squeak-dev mailing list