Stéphane Ducasse wrote:
> 
> Stan 
> did you compare/have a look at spaceTally because it is also reporting
> memory consumption
> and may be we could make everything better. (I just read my mails between
> two houses fixes).
> I will take more time this evening if I can.
> Anyway thanks. I like these kinds of discussions. Because I learn stuff or
> they make me think
> and rethink what I think I  know
> 
> Stef
> 
> 

SpaceTally uses allInstances for each class.

[(SpaceTally new systemWideSpaceTally asSortedCollection: 
        [:a :b | a spaceForInstances > b spaceForInstances])
                 asArray inspect] timeToRun 363332 on a slow machine.

Could probably be made somewhat faster by keeping a count of all classes'
instances during one pass.

Senders of allSubInstances with their number of subclasses
----------------------------------------------------------

a MethodReference Behavior >> #inspectSubInstances->3396
a MethodReference Morph class >> #morphsUnknownToTheirOwners->221
a MethodReference Morph >> #morphsUnknownToTheirOwners->221
a MethodReference Set class >> #rehashAllSets->21
a MethodReference Set >> #rehashAllSets->21
a MethodReference UITheme class >> #closeExampleDialogs->6
a MethodReference UITheme >> #closeExampleDialogs->6
a MethodReference FT2Handle class >> #shutDown:->5
a MethodReference FT2Handle >> #shutDown:->5
a MethodReference Categorizer class >> #sortAllCategories->4
a MethodReference Categorizer >> #sortAllCategories->4
a MethodReference TTCFont class >> #recreateCache->2
a MethodReference TTCFont >> #recreateCache->2
a MethodReference Symbol class >> #rehash->2
a MethodReference Symbol >> #rehash->2
a MethodReference StrikeFont class >> #setupDefaultFallbackFont->2
a MethodReference StrikeFont >> #setupDefaultFallbackFont->2
a MethodReference WAProcessStatus >> #processes->0
a MethodReference Utilities class >> #closeAllDebuggers->0
a MethodReference Utilities >> #closeAllDebuggers->0
...etc

Morph morphsUnKnownToTheirOwners timeToRun is 10s; could be faster, but has
no senders.

Senders of allSubInstancesDo: with their number of subclasses
----------------------------------------------------------

a MethodReference Behavior >> #allSubInstances->3396
a MethodReference Behavior >> #allInstancesEverywhereDo:->3396
a MethodReference ClassDescription >> #updateInstancesFrom:->3395
a MethodReference WASqueakStatusItem >> #numberOfSessions->8
a MethodReference MCFileBasedRepository class >> #flushAllCaches->5
a MethodReference MCFileBasedRepository >> #flushAllCaches->5
a MethodReference PopUpMenu class >> #setMenuFontTo:->3
a MethodReference PopUpMenu class >> #initialize->3
a MethodReference PopUpMenu >> #setMenuFontTo:->3
a MethodReference PopUpMenu >> #initialize->3
a MethodReference ChangeList >> #selectConflictsWith->3
a MethodReference TTCFont class >> #initialize->2
a MethodReference TTCFont >> #initialize->2
a MethodReference StrikeFont class >> #shutDown->2
a MethodReference StrikeFont >> #shutDown->2
a MethodReference WARegistry class >> #clearAll->1
a MethodReference WARegistry >> #clearAll->1
a MethodReference ShortIntegerArray class >> #swapShortObjects->1
a MethodReference ShortIntegerArray >> #swapShortObjects->1
a MethodReference Preferences class >> #smartUpdatingChanged->1
a MethodReference Preferences class >> #setFlapsFontTo:->1
...etc

Metaclass is the sole sender of allInstancesEverywhereDo:

Conclusion- there are no cases which clearly need attention, with the
possible exception of Object>>allSubInstances


It might be worth catching calls to #allSubInstances, #allSubInstancesDo:
where subclasses size > say 100, as Martin mentioned.

-- 
View this message in context: 
http://n2.nabble.com/Issue-1634-Object-allSubInstances-slooooow-tp4189848p4197665.html
Sent from the Pharo Smalltalk mailing list archive at Nabble.com.

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to