While I love the idea of sharing the systemDictionary class binding in the 
method to gain immediate update in case of
change I was questioning myself if we could not gain from not having (for 
example to get parametrized modules).

The point is that we are not constantly changing classes especially when not 
programming but running program.

So let us do some experiments:

CompiledMethod allInstances size 
        58891

(CompiledMethod allInstances select: [:each | each classBinding value name = 
#Point]) size 
        100

[CompiledMethod allInstances select: [:each | each classBinding value name = 
#Point]] timeToRun 
        23

this is the best case since classBinding is at a fixed size

now looking for any reference to Point

(CompiledMethod allInstances select: [:cm | 
        cm literals anySatisfy: [:each | each class = Association
                                                                and: [each key 
= #Point ]]]) size
        134 methods.

[CompiledMethod allInstances select: [:cm | 
        cm literals anySatisfy: [:each | each class = Association
                                                                and: [each key 
= #Point ]]]] timeToRun 
91 ms

so it looks to me that this sharing is not something that we should not changed 
if needed.

What do you think?

Stef

Reply via email to