Speeding up the Browser

Eddie Cottongim cottonsqueak at earthlink.net
Sat Sep 7 06:15:46 UTC 2002


I've noticed that changing classes in the Browser is sluggish. (Squeak 3.2g,
#4956, Win2000, p3-600). If I have the category 'Morphic-Kernel' open,
selecting 'Morph' requires about one second. Presumably, it is unusally bad
because of the high number of messages for this class. I tried this on
another (133 mhz) machine, and selecting 'Morph' required 4 to 5 seconds; in
addition, many other classes are slow enough to be objectionable. We should
be able to do better than this, right? On the slow machine, the MVC browser
was much faster (<500 ms).

I did a message tally while clicking between 'Morph' and 'HandMorph'
repeatedly, which you can see below. It looks like most of the time is being
spent populating PluggableListMorphs with items. I think the problem must be
at or below:
--   55.6% {11800ms}
PluggableMessageCategoryListMorph(PluggableListMorph)>>list:

I don't really understand whats going on beyond this point. It looks like a
lot of time is being spend recording damage and fiddling with bounds during
the list population. There are also tons of fullbounds and changed messages
which would seem to be unnecessary during the construction phase. Just for
fun, I removed the call to
'TransformMorph(Morph)>>addedOrRemovedSubmorph'. Nothing bad happened
(immediately, anyway) and it was noticeably faster. (Thats probably a bad
idea - I was just messing around).

If anyone could point me in the right direction, or point out my fallacies,
that would be great.

Thanks,
Eddie

- 1312 tallies, 21223 msec.

**Tree**
99.9% {21202ms} PasteUpMorph>>doOneCycle
  99.8% {21181ms} WorldState>>doOneCycleFor:
    78.2% {16596ms} WorldState>>doOneCycleNowFor:
      |62.9% {13349ms} HandMorph>>processEvents
      |  |62.7% {13307ms} HandMorph>>handleEvent:
      |  |  61.4% {13031ms} HandMorph>>sendMouseEvent:
      |  |    61.4% {13031ms} HandMorph>>sendEvent:focus:clear:
      |  |      60.1% {12755ms} HandMorph>>sendFocusEvent:to:clear:
      |  |        60.1% {12755ms}
PluggableListMorph(Morph)>>handleFocusEvent:
      |  |          60.1% {12755ms} PluggableListMorph(Morph)>>handleEvent:
      |  |            60.1% {12755ms} MouseButtonEvent>>sentTo:
      |  |              60.1% {12755ms}
PluggableListMorph(Morph)>>handleMouseUp:
      |  |                60.1% {12755ms} PluggableListMorph>>mouseUp:
      |  |                  60.1% {12755ms}
PluggableListMorph>>setSelectedMorph:
      |  |                    60.1% {12755ms}
PluggableListMorph>>changeModelSelection:
      |  |                      60.1% {12755ms} Browser>>classListIndex:
      |  |                        58.7% {12458ms} Browser(Object)>>changed:
      |  |                          58.2% {12352ms}
PluggableMessageCategoryListMorph(PluggableListMorph)>>update:
      |  |                            55.6% {11800ms}
PluggableMessageCategoryListMorph(PluggableListMorph)>>list:
      |  |                              |30.3% {6431ms}
TransformMorph(Morph)>>addAllMorphs:
      |  |                              |  |29.1% {6176ms}
TransformMorph(Morph)>>addedOrRemovedSubmorph:
      |  |                              |  |  21.5% {4563ms}
StringMorph(Morph)>>changed
      |  |                              |  |    |21.0% {4457ms}
StringMorph(Morph)>>invalidRect:
      |  |                              |  |    |  21.0% {4457ms}
StringMorph(Morph)>>invalidRect:from:
      |  |                              |  |    |    20.9% {4436ms}
TransformMorph>>invalidRect:from:
      |  |                              |  |    |      12.5% {2653ms}
TransformMorph(Morph)>>invalidRect:from:
      |  |                              |  |    |        |12.2% {2589ms}
PluggableMessageCategoryListMorph(Morph)>>invalidRect:from:
      |  |                              |  |    |        |  10.9% {2313ms}
SystemWindow(Morph)>>invalidRect:from:
      |  |                              |  |    |        |    8.9% {1889ms}
PasteUpMorph>>invalidRect:from:
[7.7% {1634ms} WorldState>>recordDamagedRect:
[  7.6% {1613ms} DamageRecorder>>recordInvalidRect:
[    3.7% {785ms} Rectangle>>intersect:
[      |3.1% {658ms} Rectangle class>>origin:corner:
[    2.2% {467ms} Rectangle>>area
      |  |                              |  |    |      6.5% {1379ms}
MorphicTransform(DisplayTransform)>>localBoundsToGlobal:
      |  |                              |  |    |        3.0% {637ms}
MorphicTransform(DisplayTransform)>>localPointsToGlobal:
      |  |                              |  |    |          |2.1% {446ms}
MorphicTransform>>localPointToGlobal:
      |  |                              |  |    |        2.5% {531ms}
Rectangle class>>encompassing:
      |  |                              |  |  7.5% {1592ms}
StringMorph>>fullBounds
      |  |                              |  |    7.5% {1592ms}
StringMorph(Morph)>>fullBounds
      |  |                              |  |      6.6% {1401ms}
StringMorph(Morph)>>layoutBounds
      |  |                              |  |        5.9% {1252ms}
StringMorph(Morph)>>innerBounds
      |  |                              |  |          4.0% {849ms}
Rectangle>>insetBy:
      |  |                              |  |            3.3% {700ms}
Rectangle class>>origin:corner:
      |  |                              |  |              2.4% {509ms}
Rectangle>>setOrigin:corner:
      |  |                              |11.5% {2441ms}
StringMorph(Morph)>>bounds:
      |  |                              |  |7.7% {1634ms}
StringMorph(Morph)>>position:
      |  |                              |  |  |4.4% {934ms}
StringMorph>>fullBounds
      |  |                              |  |  |  4.0% {849ms}
StringMorph(Morph)>>fullBounds
      |  |                              |  |  |    3.2% {679ms}
StringMorph(Morph)>>layoutBounds
      |  |                              |  |  |      2.7% {573ms}
StringMorph(Morph)>>innerBounds
      |  |                              |  |3.4% {722ms}
StringMorph(Morph)>>extent:
      |  |                              |5.9% {1252ms}
PluggableListMorph(ScrollPane)>>setScrollDeltas
      |  |                              |  |2.8% {594ms}
PluggableListMorph(ScrollPane)>>leftoverScrollRange
      |  |                              |3.8% {806ms} StringMorph
class>>contents:font:
      |  |                              |  3.7% {785ms}
StringMorph>>initWithContents:font:emphasis:
      |  |                              |    3.2% {679ms}
StringMorph>>contents:
      |  |                              |      3.0% {637ms}
StringMorph>>fitContents
      |  |                            2.4% {509ms}
PluggableListMorph>>getList
      |  |                              2.4% {509ms} Browser>>messageList
      |  |                                2.4% {509ms}
ClassOrganizer>>allMethodSelectors
      |  |                                  2.4% {509ms}
Array(ArrayedCollection)>>sort
      |9.3% {1974ms} WorldState>>displayWorldSafely:
      |  |9.0% {1910ms} PasteUpMorph>>displayWorld
      |  |  9.0% {1910ms} PasteUpMorph>>privateOuterDisplayWorld
      |  |    9.0% {1910ms} WorldState>>displayWorld:submorphs:
      |  |      7.6% {1613ms}
WorldState>>drawWorld:submorphs:invalidAreasOn:
      |  |        7.2% {1528ms} FormCanvas(Canvas)>>fullDrawMorph:
      |  |          7.2% {1528ms} FormCanvas(Canvas)>>fullDraw:
      |  |            7.2% {1528ms} SystemWindow(Morph)>>fullDrawOn:
      |  |              6.6% {1401ms} SystemWindow(Morph)>>drawSubmorphsOn:
      |  |                6.6% {1401ms} FormCanvas(Canvas)>>fullDrawMorph:
      |  |                  6.6% {1401ms} FormCanvas(Canvas)>>fullDraw:
      |  |                    6.6% {1401ms}
AlignmentMorph(Morph)>>fullDrawOn:
      |  |                      5.9% {1252ms}
AlignmentMorph(Morph)>>drawSubmorphsOn:
      |  |                        5.9% {1252ms}
FormCanvas(Canvas)>>fullDrawMorph:
      |  |                          5.8% {1231ms}
FormCanvas(Canvas)>>fullDraw:
      |  |                            5.8% {1231ms}
PluggableListMorph(Morph)>>fullDrawOn:
      |  |                              3.6% {764ms}
PluggableListMorph(Morph)>>drawSubmorphsOn:
      |  |                                3.5% {743ms}
FormCanvas(Canvas)>>fullDrawMorph:
      |  |                                  3.5% {743ms}
FormCanvas(Canvas)>>fullDraw:
      |  |                                    3.5% {743ms}
ScrollBar(Morph)>>fullDrawOn:
      |6.0% {1273ms} PasteUpMorph>>runStepMethods
      |  6.0% {1273ms} WorldState>>runStepMethodsIn:
      |    6.0% {1273ms} WorldState>>runLocalStepMethodsIn:
      |      5.5% {1167ms} StepMessage(MorphicAlarm)>>value:
      |        5.4% {1146ms} SystemWindow>>stepAt:
      |          5.4% {1146ms} Browser(Object)>>stepAt:in:
      |            5.4% {1146ms} Browser(CodeHolder)>>stepIn:
      |              5.4% {1146ms}
Browser(CodeHolder)>>updateListsAndCodeIn:
      |                5.1% {1082ms} Browser(Object)>>updateListsAndCodeIn:
      |                  5.1% {1082ms} PluggableListMorph>>verifyContents
      |                    5.0% {1061ms} PluggableListMorph>>getList
      |                      5.0% {1061ms} Browser>>messageList
      |                        5.0% {1061ms}
ClassOrganizer>>allMethodSelectors
      |                          5.0% {1061ms}
Array(ArrayedCollection)>>sort
      |                            4.1% {870ms}
Array(ArrayedCollection)>>sort:
      |                              4.1% {870ms}
Array(ArrayedCollection)>>mergeSortFrom:to:by:
      |                                2.4% {509ms} primitives
    21.4% {4542ms} WorldState>>interCyclePause:
      21.3% {4520ms} Delay>>wait
        21.3% {4520ms} primitives

**Leaves**
21.3% {4520ms} Delay>>wait
7.8% {1655ms} Rectangle class>>origin:corner:
7.1% {1507ms} Rectangle>>setOrigin:corner:
3.1% {658ms} Array(ArrayedCollection)>>mergeFirst:middle:last:into:by:
3.1% {658ms} SystemWindow(Morph)>>valueOfProperty:ifAbsent:
2.9% {615ms} Array(SequenceableCollection)>>do:
2.8% {594ms} Point>>+
2.4% {509ms} Array(ArrayedCollection)>>mergeSortFrom:to:by:

**Memory**
 old   -721,452 bytes
 young  +157,612 bytes
 used  -563,840 bytes
 free  +3,386,224 bytes

**GCs**
 full   1 totalling 497ms (2.0% uptime), avg 497.0ms
 incr  2214 totalling 2,769ms (13.0% uptime), avg 1.0ms
 tenures  51 (avg 43 GCs/tenure)
 root table 0 overflows






More information about the Squeak-dev mailing list