[squeak-dev] Re: Odd performance characteristics of symbol creation

Andreas Raab andreas.raab at gmx.de
Wed May 6 17:04:27 UTC 2009


Adrian Lienhard wrote:
> I haven't had time to look into this very closely yet but maybe somebody 
> else already knows what is going on. My guess is that the NewSymbols 
> weak set is repeatedly grown since tally is not decreased if the GC 
> removes a weak element.

That's an excellent guess. Try changing WeakSet to e.g.,

WeakSet>>atNewIndex: index put: aValue
     "Add newValue at the given index. Don't increment tally
      if current slot is nil since a previous value has been collected"
     (array at: index) ifNil:[^array at: index put: aValue].
     ^super atNewIndex: index put: aValue

Cheers,
   - Andreas




More information about the Squeak-dev mailing list