Efficient thread-local shared variables

Reinout Heeck reinz at desk.org
Tue Oct 24 14:30:39 UTC 2006

On Oct 24, 2006, at 12:13 PM, Klaus D. Witzel wrote:

> When you say that insertion/removal is slow, what do you compare  
> that to: add/remove to/from an OrderedCollection, or just compared  
> to set/get?

I was comparing to a Dictionary which does add/remove in near  
constant time.
In VW a MethodDictionary is implemented as a SortedCollection with  
the CompiledMethods sorted by the #identityHash value of their  
selector. So inserting/removing involves moving (copying) half of the  
collection one slot up/down.

> Have you considered alternatives, any comparisions or ideas that  
> you can share?

No, this was a full blown case of premature optimization, I now have  
a fast Vocabulary/SearchOrder implementation but haven't progressed  
to the real meat of implementing a new namespace system yet :-(


More information about the Squeak-dev mailing list