Screen damage logic

Lex Spoon lex at cc.gatech.edu
Wed Mar 22 17:52:05 UTC 2000


"Lex Spoon" <lex at cc.gatech.edu> wrote:

> Anyway, once we've identified some specific operations that are slow, we
> can run the profiler and/or think about how the code works, to try and
> see why it's slow.  Then we can make real progress, or at least make a
> rationale tradeoff.  The best people to do this stuff, of course, are
> people with ~100 MHz computers :)
> 
> 

For example.  I notice that the World menu takes about half a second to
pop up on my computer.  That's fairly slow for a menu, and it must be
maddening on slower computers.  So, I start the profile from the debug..
menu, and open and close the menu a bunch of times.  The full
message-tally is appended.

Here's what shows up:

	1. 43% of the time is in waiting for the user.  Fine, I can only click
the menu up and down so quickly!

	2. 10% is spent in running #step on my 6 or so browsers.  This is
wasteful, but irrelevant.  (It shows up in other places as well).  It
might not be worth optimizing.

	3. 25% is spent in drawing routines.  We've established that my
computer has relatively slow  Squeak graphics, so optimizing this is
unlikely to get anywhere.  And anyway, it's not the drawing that I'm
seeing trouble with--it's how long it takes for the darned thing to pop
up at all.

	4. 15% spent in buildWorldMenu.  Now we're talking--why in the world
would it take so long to build a stupid 15-item menu?  Ahhh.  It is
running "self world project", which ends up scanning all of memory to
find the relevant project.  I'm not sure what the best way to optimize
this is, but it clearly makes a difference.  I'll turn on the
simpleMenus preference for now, thus disabling the offending menu item,
and now the Word menu is quite zippy.


I'll leave fixing this better to other minds.  It's not clear that this
is actually worth optimizing, since it's in the middle of exploratory
development.

Perhaps other cases, though, *will* turn out to be stupid things that we
may as well nail down and optimize.  Have at it, guys, especially people
with really slow computers :)


Lex




=====
 - 1518 tallies, 30330 msec.

**Tree**
99.9 PasteUpMorph>>doOneCycle
  57.0 PasteUpMorph>>doOneCycleNow
    |25.2 PasteUpMorph>>displayWorldSafely
    |  |25.2 PasteUpMorph>>displayWorld
    |  |  22.1 PasteUpMorph>>drawInvalidAreasOn:
    |  |    8.2 SystemWindow>>fullDrawOn:
    |  |      |8.2 SystemWindow(BorderedMorph)>>fullDrawOn:
    |  |      |  7.9 SystemWindow(Morph)>>fullDrawOn:
    |  |      |    6.5 SystemWindow(Morph)>>drawSubmorphsOn:
    |  |      |      6.5 FormCanvas(Canvas)>>fullDrawMorph:
    |  |      |        6.1 FormCanvas(Canvas)>>fullDraw:
    |  |      |          6.1 PluggableTextMorph(BorderedMorph)>>fullDrawOn:
    |  |      |            4.9 PluggableTextMorph(Morph)>>fullDrawOn:
    |  |      |              2.8 PluggableTextMorph(Morph)>>drawSubmorphsOn:
    |  |      |                |2.8 FormCanvas(Canvas)>>fullDrawMorph:
    |  |      |                |  2.7 FormCanvas(Canvas)>>fullDraw:
    |  |      |                |    2.6 TransformMorph(Morph)>>fullDrawOn:
[2.6 TransformMorph>>drawSubmorphsOn:
[  2.3 FormCanvas(Canvas)>>fullDrawMorph:
    |  |      |              2.1 FormCanvas(Canvas)>>drawMorph:
    |  |      |                2.1 FormCanvas(Canvas)>>draw:
    |  |    5.3 MenuMorph(BorderedMorph)>>fullDrawOn:
    |  |      |5.3 MenuMorph(BorderedMorph)>>fullDrawWithRoundedCornersOn:
    |  |      |  3.8 MenuMorph(Morph)>>fullDrawOn:
    |  |      |    3.2 MenuMorph(Morph)>>drawSubmorphsOn:
    |  |      |      3.1 FormCanvas(Canvas)>>fullDrawMorph:
    |  |      |        2.5 FormCanvas(Canvas)>>fullDraw:
    |  |      |          2.2 MenuItemMorph(Morph)>>fullDrawOn:
    |  |    2.0 primitives
    |21.9 HandMorph>>processEvents
    |  |21.9 HandMorph>>handleEvent:
    |  |  18.0 HandMorph>>handleMouseDown:
    |  |    |18.0 PasteUpMorph>>mouseDown:
    |  |    |  18.0 HandMorph>>invokeMetaMenu:
    |  |    |    14.6 HandMorph>>buildWorldMenu
    |  |    |      14.5 PasteUpMorph>>project
    |  |    |        14.5 Project class>>ofWorld:
    |  |    |          14.5 Project class(Behavior)>>allSubInstances
    |  |    |            14.5 Project class(Behavior)>>allSubInstancesDo:
    |  |    |              14.5 Project class(Behavior)>>allInstancesDo:
    |  |    |                10.5 primitives
    |  |    |                4.0 Project(ProtoObject)>>nextInstance
    |  |  2.5 HandMorph>>handleMouseMove:
    |9.8 PasteUpMorph>>runStepMethods
    |  6.6 SystemWindow>>stepAt:
    |    |6.6 Browser(Object)>>stepAt:in:
    |    |  6.6 Browser(CodeHolder)>>stepIn:
    |    |    6.6 Browser(CodeHolder)>>updateListsAndCodeIn:
    |    |      4.9 Browser(Object)>>updateListsAndCodeIn:
    |    |        4.6 PluggableListMorph>>verifyContents
    |    |          3.9 PluggableListMorph>>getList
    |    |            3.8 Browser>>messageList
    |    |              2.6 Browser>>messageCategoryListSelection
    |    |                2.5 Browser>>messageCategoryList
    |    |                  2.2 ClassOrganizer class>>allCategory
    |    |                    2.2 String>>asSymbol
    |    |                      2.2 Symbol class>>intern:
    |  2.1 OrderedCollection>>do:
  43.0 PasteUpMorph>>interCyclePause:
    42.9 Delay>>wait

**Leaves**
42.9 Delay>>wait
10.5 Project class(Behavior)>>allInstancesDo:
4.0 Project(ProtoObject)>>nextInstance
2.8 Symbol class>>intern:
2.6 Array(SequenceableCollection)>>do:
2.5 OrderedCollection>>do:
2.0 PasteUpMorph>>drawInvalidAreasOn:





More information about the Squeak-dev mailing list