[squeak-dev] Re: SparseLargeTable

nicolas cellier ncellier at ifrance.com
Wed Nov 5 20:36:25 UTC 2008


Hi Stef,
I already experimented Eliot's SparseTable changes in Pharo, but I'm 
waiting for stabilization before publishing.


stephane ducasse a écrit :
> 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