Need an efficient large weak identity key dictionary
Scott A Crosby
scrosby at cs.rice.edu
Tue Aug 27 00:24:31 UTC 2002
On Sun, 11 Aug 2002 16:30:54 +0200, "Andreas Raab" <Andreas.Raab at gmx.de> writes:
> polymorphic keys this may help quite a bit to overcome the current
> limitations of the 12 bit hashes.
>
To quote:
> > WeakIdentityKeyDictionary. A small test that adds 10000 items to
> > the dictionary went from 150 seconds to just 5.5 seconds on my
> > machine after making that change.
Generally, 12 bits is 'OK' for up to, say, 4000-40000 objects. the
issue is those bits being completely wasted. For example, in this
case. Or in similar cases I reported, oh, about 9 months ago, and
submitted a changeset about 6 months ago.
True, in this example, using polymorphity of the keys is worth a few
extra bits (scaling us up to say, 1m objects), but if its the design
has flaws, fix the flaws first, then see if it needs enhancement.
Scott
More information about the Squeak-dev
mailing list
|