Yeah, that could be a problem. Strangely SystemDictionary is a
subclass of IdentityDictionary.

It can be easily fixed, don't know if this has much of an impact on
performance if the dictionary is smaller:

  SystemDictionary superclass: Dictionary.
  SystemDictionary allInstances do: [ :each | each rehash ]

Lukas

2009/10/25 Stéphane Ducasse <[email protected]>:
> Ok I see. I would be curious to see if SystemDictionary does not
> degrade once we load
> Moose, Mondrian, Glamour....
>
>>> So this means that by default we have bad performance. no?
>>
>> No.
>>
>> In a fresh Pharo Web image less than 6% of the keys in Dictionaries
>> and less than 10% of the values in Sets have a weak-hashes. Moreover
>> the largest set with weak-hash values has 516 elements (on average
>> only 1.8 elements), the largest dictionary with weak-hash keys has
>> 1002 elements (on average only 4.3 elements). Using HashTable in such
>> a situation would introduce a major speed penalty and waste a lot of
>> memory.
>>
>> It would be cool if the Set and the Dictionary would choose their
>> implementation strategy automatically depending on the use-case. In a
>> standard Pharo image however that would just be the current
>> implementation. There are simply no instances in the image where it
>> would be worthwhile (large amount of data with bad hash) to use a
>> HashMap.
>>
>> Lukas
>>
>> --
>> Lukas Renggli
>> http://www.lukas-renggli.ch
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [email protected]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



-- 
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to