[Pharo-project] [update 1.2] #12161 - #12172

Stéphane Ducasse stephane.ducasse at inria.fr
Sat Oct 2 02:59:59 EDT 2010


OK marcus will give a try.
We will have to clean all these points with weakstuff once for all and getting more or less aligned with the work levente did.


Stef

On Oct 1, 2010, at 5:48 PM, Igor Stasenko wrote:

> Here what happens:
> 
> Original method WeakKeyDictionary>>finalizeValues
> 
> WeakKeyDictionary>>finalizeValues
> 	"Clear all associations with nil keys"
> 	array do:[:assoc|
> 	1 to: array size do:[:i | | assoc |
> 		assoc := array at: i.
> 		assoc ifNotNil:[
> 			assoc expire ifTrue:[
> 				expired := expired + 1.
> 				tally := tally - 1.
> 			].
> 		].
> 	].
> 
> And i noticed that after recompilation of this method, it starts
> spending much more time to scan 14k entries:
> 
> [MCMethodDefinition cachedDefinitions finalizeValues ] timeToRun
> 167
> 
> (my guess that this method was never recompiled with new Eliot's closures).
> 
> Now, if i change it to:
> finalizeValues
> 	"Clear all associations with nil keys"
> 	1 to: array size do:[:i | | assoc |
> 		assoc := array at: i.
> 	array do:[:assoc|
> 		assoc ifNotNil:[
> 			assoc expire ifTrue:[
> 				expired := expired + 1.
> 				tally := tally - 1.
> 			].
> 		].
> 	].
> 
> so, #to:do: is inlined by compiler, then numbers is much better:
> 
> [MCMethodDefinition cachedDefinitions finalizeValues ] timeToRun
> 4
> 
> Just try it yourself, if you not believe.
> 
> -- 
> Best regards,
> Igor Stasenko AKA sig.
> 
> _______________________________________________
> Pharo-project mailing list
> Pharo-project at lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project





More information about the Pharo-dev mailing list