[Magma] test result

Stephen Pair spair at acm.org
Mon Aug 5 18:41:07 UTC 2002


Chris,

> -----Original Message-----
> From: squeak-dev-admin at lists.squeakfoundation.org 
> [mailto:squeak-dev-admin at lists.squeakfoundation.org] On 
> Behalf Of Chris Muller
> Sent: Monday, August 05, 2002 1:19 PM
> To: Squeak List
> Subject: [Magma] test result
> 
> 
> Stephen pair wrote:
> 
> Time millisecondsToRun: 
> 	[self commit:
> 		[| tmp |
> 		tmp := Dictionary new.
> 		1 to: 1000 do: [ :in | tmp at: in asString put: in
> asString ].
> 		self root at: 'er2' put: tmp]].
> 
> The commit operation took about 5 hours (PIII 1Ghz...running 
> a single user MagmaSession).  I haven't had a chance to see 
> why it's taking so long.  I also didn't try reloading the dictionary.
> 
> === answer ===
> 
> Actually, the commit only took a few seconds.  The remaining 
> 4.999 hours were spent in Squeaks Dictionary code after the commit.
> 
> When new objects are created, such as the 2001 new objects 
> you created here, Magma assigns them a "temporary oid".  This 
> is done to 1) know its a new object, and 2) because the 
> permanent oid has to be determined on the server.
> 
> So, part of the commit result is the permanent oid for each 
> temporary oid. 
> After returning from the commit on the server, a call to
> MagmaSession>>assignPermanentLoidsFrom: goes through the 2001 
> entries in 
> MagmaSession>>the
> commit result which map the temp oid to its permanent oid and 
> removesKey: the temp oid and at:put:'s the new.
> 
> To sum it up, it was 5 hours for Squeak to do 2001 
> removeKey's followed by 2001 at:put:'s.  Is this related to 
> the 12-bit hashing issue you brought up earlier??

Yes, it's sounds very likely.  What's the total size of the oid map?

> Committing 2000 new objects in one transaction is what I'd 
> call a medium-sized transaction at best, but 5 hours is 
> certainly unacceptable.
> 
> What can be done?

Here are a couple random ideas:

- Modify the vm (object memory) to have a larger identity hash
- Create a new kind of dictionary that speads the current identity hash
out (will have the same amount of collisions, but will not have to
search as far for an open slot)
- Build a new oid map rather than removing and re-inserting
- Somehow create permanent oids to begin with

- Stephen




More information about the Squeak-dev mailing list