Morphic slowness (was Re: Does *anyone* use MVC?)

Bob Arning arning at charm.net
Thu Aug 1 23:30:12 UTC 2002


On Thu, 1 Aug 2002 15:44:37 -0700 Ned Konz <ned at bike-nomad.com> wrote:
>Here's what I tried on my WinCE machine (131MHz MIPS).
>
>It takes 4.2 seconds to open the World Menu
>(and about 1 second to see characters that I type into a Workspace!).
>
...
>
>In 3.2, I did this:
>
>MessageTally spyOn: [ World putUpWorldMenu: ActiveEvent ]

For a comparison, here are numbers from a 700-MHz iMac (note that this opens 100 world menus), but first, some observations:
====
    |    |  |17.0% {696ms} MenuItemMorph(Morph)>>setBalloonText:
    |    |  |  17.0% {696ms} MenuItemMorph(Morph)>>setBalloonText:maxLineLength:
    |    |  |    17.0% {696ms} String>>withNoLineLongerThan:
you could defer breaking the balloon text up until you really needed to display it since that is the exception rather than the rule.
====
    |    7.7% {315ms} PasteUpMorph>>startSteppingSubmorphsOf:
    |      7.7% {315ms} MenuItemMorph(Morph)>>wantsSteps
    |        7.7% {315ms} StringMorph class(Behavior)>>includesSelector:
    |          7.7% {315ms} MethodDictionary>>includesKey:
this seems a bit much.
====
**GCs**
	full			0 totalling 0ms (0.0% uptime)
	incr		367 totalling 694ms (17.0% uptime), avg 2.0ms
maybe this could be reduced? Larger allocation threshholds, e.g.
================
MessageTally spyOn: [ 100 timesRepeat: [World putUpWorldMenu: ActiveEvent] ]

 - 235 tallies, 4093 msec.

**Tree**
100.0% {4093ms} PasteUpMorph>>putUpWorldMenu:
  57.9% {2370ms} MenuMorph>>popUpEvent:in:
    |57.9% {2370ms} MenuMorph>>popUpAt:forHand:in:
    |  57.9% {2370ms} MenuMorph>>popUpAt:forHand:in:allowKeyboard:
    |    49.4% {2022ms} MenuMorph>>positionAt:relativeTo:inWorld:
    |      |48.9% {2001ms} MenuMorph(Morph)>>fullBounds
    |      |  48.9% {2001ms} MenuMorph(Morph)>>doLayoutIn:
    |      |    46.0% {1883ms} TableLayout>>layout:in:
    |      |      |46.0% {1883ms} TableLayout>>layoutTopToBottom:in:
    |      |      |  27.7% {1134ms} MenuLineMorph(Morph)>>layoutInBounds:
    |      |      |    |13.2% {540ms} MenuItemMorph(Morph)>>bounds:
    |      |      |    |  |9.8% {401ms} MenuItemMorph(Morph)>>extent:
    |      |      |    |  |  |9.4% {385ms} MenuItemMorph(Morph)>>changed
    |      |      |    |  |  |  6.4% {262ms} MenuItemMorph(Morph)>>invalidRect:
    |      |      |    |  |  |    |6.4% {262ms} MenuItemMorph(Morph)>>invalidRect:from:
    |      |      |    |  |  |    |  3.4% {139ms} MenuMorph(Morph)>>invalidRect:from:
    |      |      |    |  |  |    |  3.0% {123ms} MenuItemMorph(Morph)>>wonderlandTexture
    |      |      |    |  |  |    |    3.0% {123ms} MenuItemMorph(Morph)>>valueOfProperty:ifAbsent:
[3.0% {123ms} MorphExtension>>valueOfProperty:ifAbsent:
[  3.0% {123ms} IdentityDictionary(Dictionary)>>at:ifAbsent:
[    3.0% {123ms} IdentityDictionary(Set)>>findElementOrNil:
[      3.0% {123ms} IdentityDictionary>>scanFor:
    |      |      |    |  |  |  3.0% {123ms} MenuItemMorph(Morph)>>outerBounds
    |      |      |    |  |  |    3.0% {123ms} MenuItemMorph(Morph)>>hasRolloverBorder
    |      |      |    |  |  |      3.0% {123ms} MenuItemMorph(Morph)>>valueOfProperty:ifAbsent:
    |      |      |    |  |  |        3.0% {123ms} MorphExtension>>valueOfProperty:ifAbsent:
[3.0% {123ms} IdentityDictionary(Dictionary)>>at:ifAbsent:
[  3.0% {123ms} IdentityDictionary(Set)>>findElementOrNil:
[    3.0% {123ms} IdentityDictionary>>scanFor:
    |      |      |    |  |3.4% {139ms} MenuItemMorph(Morph)>>position:
    |      |      |    |  |  2.6% {106ms} MenuItemMorph(Morph)>>privateFullMoveBy:
    |      |      |    |  |    2.6% {106ms} MenuItemMorph(Morph)>>privateMoveBy:
    |      |      |    |6.0% {246ms} MenuLineMorph(Morph)>>layoutBounds
    |      |      |    |  |6.0% {246ms} MenuLineMorph(Morph)>>layoutInset
    |      |      |    |  |  6.0% {246ms} MenuLineMorph(Morph)>>layoutProperties
    |      |      |    |  |    6.0% {246ms} MorphExtension>>layoutProperties
    |      |      |    |  |      6.0% {246ms} MorphExtension>>valueOfProperty:ifAbsent:
    |      |      |    |  |        6.0% {246ms} IdentityDictionary(Dictionary)>>at:ifAbsent:
    |      |      |    |  |          6.0% {246ms} IdentityDictionary(Set)>>findElementOrNil:
[6.0% {246ms} IdentityDictionary>>scanFor:
    |      |      |    |3.8% {156ms} AlignmentMorph(Morph)>>doLayoutIn:
    |      |      |    |  3.8% {156ms} TableLayout>>layout:in:
    |      |      |    |    3.8% {156ms} TableLayout>>layoutTopToBottom:in:
    |      |      |    |      3.8% {156ms} StringMorph(Morph)>>layoutInBounds:
    |      |      |    |        3.8% {156ms} StringMorph(Morph)>>position:
    |      |      |    |          3.8% {156ms} StringMorph(Morph)>>invalidRect:
    |      |      |    |            3.8% {156ms} StringMorph(Morph)>>invalidRect:from:
[3.8% {156ms} AlignmentMorph(Morph)>>invalidRect:from:
[  3.8% {156ms} AlignmentMorph(Morph)>>clipSubmorphs
[    3.8% {156ms} AlignmentMorph(Morph)>>valueOfProperty:ifAbsent:
[      3.8% {156ms} MorphExtension>>valueOfProperty:ifAbsent:
[        3.8% {156ms} IdentityDictionary(Dictionary)>>at:ifAbsent:
[          3.8% {156ms} IdentityDictionary(Set)>>findElementOrNil:
[            3.8% {156ms} IdentityDictionary>>scanFor:
    |      |      |  18.3% {749ms} MenuItemMorph(Morph)>>minExtent
    |      |      |    10.2% {417ms} MenuItemMorph(StringMorph)>>fullBounds
    |      |      |      |10.2% {417ms} MenuItemMorph(Morph)>>fullBounds
    |      |      |      |  6.8% {278ms} MenuItemMorph(Morph)>>doLayoutIn:
    |      |      |      |    |6.4% {262ms} MenuItemMorph(Morph)>>outerBounds
    |      |      |      |    |  6.4% {262ms} MenuItemMorph(Morph)>>hasDropShadow
    |      |      |      |    |    6.4% {262ms} MenuItemMorph(Morph)>>valueOfProperty:ifAbsent:
    |      |      |      |    |      6.4% {262ms} MorphExtension>>valueOfProperty:ifAbsent:
[6.4% {262ms} IdentityDictionary(Dictionary)>>at:ifAbsent:
[  6.4% {262ms} IdentityDictionary(Set)>>findElementOrNil:
[    6.4% {262ms} IdentityDictionary>>scanFor:
    |      |      |      |  3.4% {139ms} MenuItemMorph(Morph)>>layoutBounds
    |      |      |      |    3.4% {139ms} MenuItemMorph(Morph)>>innerBounds
    |      |      |      |      3.4% {139ms} Rectangle>>insetBy:
    |      |      |      |        3.4% {139ms} Point>>+
    |      |      |      |          3.4% {139ms} SmallInteger(Number)>>adaptToPoint:andSend:
[3.4% {139ms} Point>>+
    |      |      |    6.8% {278ms} MenuItemMorph(Morph)>>layoutPolicy
    |      |      |      6.8% {278ms} MorphExtension>>layoutPolicy
    |      |      |        6.8% {278ms} MorphExtension>>valueOfProperty:ifAbsent:
    |      |      |          6.8% {278ms} IdentityDictionary(Dictionary)>>at:ifAbsent:
    |      |      |            6.8% {278ms} IdentityDictionary(Set)>>findElementOrNil:
    |      |      |              6.8% {278ms} IdentityDictionary>>scanFor:
    |      |    3.0% {123ms} MenuMorph(Morph)>>adjustLayoutBounds
    |      |      3.0% {123ms} MenuMorph(Morph)>>submorphBounds
    |      |        3.0% {123ms} MenuItemMorph(StringMorph)>>fullBounds
    |      |          3.0% {123ms} MenuItemMorph(Morph)>>fullBounds
    |    7.7% {315ms} PasteUpMorph>>startSteppingSubmorphsOf:
    |      7.7% {315ms} MenuItemMorph(Morph)>>wantsSteps
    |        7.7% {315ms} StringMorph class(Behavior)>>includesSelector:
    |          7.7% {315ms} MethodDictionary>>includesKey:
  37.9% {1551ms} PasteUpMorph>>buildWorldMenu:
    |37.9% {1551ms} TheWorldMenu>>buildWorldMenu
    |  31.9% {1306ms} TheWorldMenu>>fillIn:from:
    |    |17.0% {696ms} MenuMorph>>balloonTextForLastItem:
    |    |  |17.0% {696ms} MenuItemMorph(Morph)>>setBalloonText:
    |    |  |  17.0% {696ms} MenuItemMorph(Morph)>>setBalloonText:maxLineLength:
    |    |  |    17.0% {696ms} String>>withNoLineLongerThan:
    |    |  |      9.8% {401ms} String>>withBlanksTrimmed
    |    |  |        |6.8% {278ms} String(SequenceableCollection)>>findLast:
    |    |  |      3.8% {156ms} String>>indexOf:
    |    |  |      3.4% {139ms} OrderedCollection class>>new
    |    |  |        3.4% {139ms} OrderedCollection class>>new:
    |    |14.9% {610ms} MenuMorph>>add:target:selector:argumentList:
    |    |  6.0% {246ms} MenuItemMorph>>contents:
    |    |    |6.0% {246ms} MenuItemMorph>>contents:withMarkers:
    |    |    |  6.0% {246ms} MenuItemMorph>>contents:withMarkers:inverse:
    |    |    |    5.1% {209ms} MenuItemMorph(StringMorph)>>contents:
    |    |    |      5.1% {209ms} MenuItemMorph(StringMorph)>>fitContents
    |    |    |        5.1% {209ms} MenuItemMorph(Morph)>>extent:
    |    |    |          3.8% {156ms} MenuItemMorph(Morph)>>changed
    |    |    |            3.8% {156ms} MenuItemMorph(Morph)>>outerBounds
    |    |    |              3.8% {156ms} MenuItemMorph(Morph)>>hasDropShadow
    |    |    |                3.8% {156ms} MenuItemMorph(Morph)>>valueOfProperty:ifAbsent:
    |    |    |                  3.8% {156ms} MorphExtension>>valueOfProperty:ifAbsent:
    |    |    |                    3.8% {156ms} IdentityDictionary(Dictionary)>>at:ifAbsent:
[3.8% {156ms} IdentityDictionary(Set)>>findElementOrNil:
[  3.8% {156ms} IdentityDictionary>>scanFor:
    |    |  4.7% {192ms} MenuMorph(Morph)>>addMorphBack:
    |    |    |4.7% {192ms} MenuMorph(Morph)>>privateAddMorph:atIndex:
    |    |    |  4.7% {192ms} Array(SequenceableCollection)>>copyReplaceFrom:to:with:
    |    |  4.3% {176ms} MenuItemMorph class(Morph class)>>new
    |    |    3.4% {139ms} MenuItemMorph>>initialize
    |    |      2.6% {106ms} MenuItemMorph(Morph)>>hResizing:
    |    |        2.6% {106ms} MenuItemMorph(Morph)>>assureLayoutProperties
    |    |          2.6% {106ms} MenuItemMorph(Morph)>>layoutProperties:
    |    |            2.6% {106ms} MorphExtension>>layoutProperties:
    |    |              2.6% {106ms} MorphExtension>>setProperty:toValue:
    |    |                2.6% {106ms} IdentityDictionary(Dictionary)>>at:put:
    |    |                  2.6% {106ms} Association class>>key:value:
    |    |                    2.6% {106ms} Association class(LookupKey class)>>key:
    |  6.0% {246ms} MenuMorph>>addStayUpItem
    |    6.0% {246ms} MenuMorph>>add:target:selector:argumentList:
    |      6.0% {246ms} MenuItemMorph class(Morph class)>>new
    |        6.0% {246ms} MenuItemMorph>>initialize
    |          6.0% {246ms} MenuItemMorph(Morph)>>hResizing:
    |            6.0% {246ms} MenuItemMorph(Morph)>>assureLayoutProperties
    |              6.0% {246ms} MenuItemMorph(Morph)>>layoutProperties:
    |                6.0% {246ms} MorphExtension>>layoutProperties:
    |                  6.0% {246ms} MorphExtension>>setProperty:toValue:
    |                    6.0% {246ms} IdentityDictionary(Dictionary)>>at:put:
    |                      6.0% {246ms} Association class>>key:value:
    |                        6.0% {246ms} Association class(LookupKey class)>>key:
  4.3% {176ms} MenuMorph>>addTitle:
    4.3% {176ms} MenuMorph>>addTitle:updatingSelector:updateTarget:
      4.3% {176ms} String>>findTokens:
        4.3% {176ms} String(SequenceableCollection)>>copyFrom:to:

**Leaves**
46.0% {1883ms} IdentityDictionary>>scanFor:
8.5% {348ms} Association class(LookupKey class)>>key:
7.7% {315ms} MethodDictionary>>includesKey:
6.8% {278ms} String(SequenceableCollection)>>findLast:
6.0% {246ms} String(SequenceableCollection)>>copyFrom:to:
4.7% {192ms} Rectangle class>>origin:corner:
4.7% {192ms} Array(SequenceableCollection)>>copyReplaceFrom:to:with:
3.8% {156ms} String>>indexOf:
3.4% {139ms} Point>>+
3.4% {139ms} OrderedCollection class>>new:

**Memory**
	old			+1,394,700 bytes
	young		-342,872 bytes
	used		+1,051,828 bytes
	free		-1,051,828 bytes

**GCs**
	full			0 totalling 0ms (0.0% uptime)
	incr		367 totalling 694ms (17.0% uptime), avg 2.0ms
	tenures		25 (avg 14 GCs/tenure)
	root table	0 overflows




More information about the Squeak-dev mailing list