[squeak-dev] The Trunk: Collections-ul.915.mcz

tim Rowledge tim at rowledge.org
Tue Oct 6 16:55:59 UTC 2020



> On 2020-10-06, at 5:17 AM, Levente Uzonyi <leves at caesar.elte.hu> wrote:
> 
> 
> AFAIK PluggableDictionary was not part of Smalltalk-80, but Dictionary and IdentityDictionary were.

Correct.

> 
> Dictionary and IdentityDictionary are slightly faster than their PluggableDictionary equivalents.

Yah; the #scanFor.... methods will be slightly slower because of the test for the relevant block. However, for anything much more complicated than a SmallInteger #= test I suspect that the actual total time will be very close. After all the object being added has to evaluate its #= against whatever is already in the slot and comparing two Wooblies with 100 instvars (and instvar related sub-tests) to try will likely swamp the #scanFor... loop.

I don't think I've had any reason to use a PluggableDictionary before but I can see that having a way to use an application specific equivalence check instead of relying on a system-wide and inevitably limiting definition has its uses. I can imagine cases where one might need two dictionaries of nominally the same contents but where the equivalence test for inclusion needs to be different in order to make comparisons of some interesting state.


tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Strange OpCodes: DC: Divide and Conquer




More information about the Squeak-dev mailing list