[squeak-dev] SparseLargeTable
Eliot Miranda
eliot.miranda at gmail.com
Sat Nov 1 19:12:21 UTC 2008
Hi All,
SparseLargeTable appears not to be sparse at all. If you look
at SparseLargeTable>>initChunkSize:size:arrayClass:base:defaultValue: you'll
see tat each bin is initialized with an instance of the base class rather
than being filled lazily. Further, instead of pvtNoCheckAt:put: lazily
creating an entry in each bin as needed it simply throws away the write if
the bin is empty. Instead the usage pattern is to create fully-populated
instances and then make them sparse by sending zapDefaultOnlyEntries.
It seems to me
that SparseLargeTable>>initChunkSize:size:arrayClass:base:defaultValue:
should leave bins empty until pvtNoCheckAt:put: puts other than the default
value. Since I want to create a sparse table with 2^32 entries the existing
approach won't work.
I wondered whether anyone else had already fixed this or whether there's a
good reason not to lazily initialize.
Best
Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20081101/804c77e8/attachment.htm
More information about the Squeak-dev
mailing list
|