[squeak-dev] SparseLargeTable
stephane ducasse
stephane.ducasse at free.fr
Wed Nov 5 20:14:19 UTC 2008
Eliot
if /when you have something, I would be more than happy to harvest the
fixes.
stef
On Nov 1, 2008, at 8:12 PM, Eliot Miranda wrote:
> 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
>
More information about the Squeak-dev
mailing list
|