Graphics Performance (mostly Connectors 2.0)

Michael Latta lattam at mac.com
Wed Dec 29 22:16:31 UTC 2004


At the bottom of this message is a MessageTally on dragging a shape  
around with 8 connectors attached to it.  These connectors have no  
arrow heads, but spend a fair amount of time dealing with arrow heads.

Ned:

1) Is there some way to optimize this case?
2) Are you drawing an empty arrow on these cases, and spending time  
building and possibly rotating an empty form, or a form with a short  
line?

General:

1) I had to comment out the delay at the end of each interaction cycle.  
  While this does mean the CPU is running at 100%, Unix can handle that,  
and even with high performance set it was taking 14%-30% in waiting on  
that delay.  With it disabled interaction is better, but still not  
really keeping up with the mouse.
2) It appears that Balloon draws to a form and then BitBlt the form to  
the screen.  Is this correct?  It is spending a fair amount of time  
doing this copying of bits.

It looks like my next task it to think about line drawing and making  
that faster.  Optimizing arrow heads would also help.  Any suggestions  
on how to proceed would be appreciated.  A similar app written in  
Objective-C is about 2x faster / more responsive.  The anti-alias of  
lines as lines rather than curves should be faster, than the current  
treatment.  For those shapes that are not being moved, it should be  
possible to cache the form that Balloon is creating.  Would this work?   
That could reduce the drawing time for larger diagrams.  My test  
diagram has 3 connectors not affected by the drag.

Michael





  - 37857 tallies, 43867 msec.

**Tree**
100.0% {43867ms} PasteUpMorph>>doOneCycle
   99.9% {43823ms} WorldState>>doOneCycleFor:
     99.9% {43823ms} WorldState>>doOneCycleNowFor:
       52.8% {23162ms} WorldState>>displayWorldSafely:
         |52.8% {23162ms} PasteUpMorph>>displayWorld
         |  52.7% {23118ms} PasteUpMorph>>privateOuterDisplayWorld
         |    52.7% {23118ms} WorldState>>displayWorld:submorphs:
         |      47.3% {20749ms}  
WorldState>>drawWorld:submorphs:invalidAreasOn:
         |        |46.5% {20398ms} FormCanvas(Canvas)>>fullDrawMorph:
         |        |  46.5% {20398ms} FormCanvas(Canvas)>>fullDraw:
         |        |    30.2% {13248ms} NCAAConnectorMorph>>fullDrawOn:
         |        |      |29.7% {13028ms}  
NCAAConnectorMorph(Morph)>>drawSubmorphsOn:
         |        |      |  29.5% {12941ms}  
FormCanvas(Canvas)>>fullDrawMorph:
         |        |      |    29.4% {12897ms}  
FormCanvas(Canvas)>>fullDraw:
         |        |      |      29.4% {12897ms}  
NCLineMorph(Morph)>>fullDrawOn:
         |        |      |        14.3% {6273ms}  
FormCanvas(Canvas)>>drawMorph:
         |        |      |          |14.3% {6273ms}  
FormCanvas(Canvas)>>draw:
         |        |      |          |  14.1% {6185ms}  
NCLineMorph>>drawOn:
         |        |      |          |    12.1% {5308ms}  
BalloonCanvas>>flush
         |        |      |          |      12.1% {5308ms}  
BalloonEngine>>flush
         |        |      |          |        12.0% {5264ms}  
BalloonEngine>>copyBits
         |        |      |          |          12.0% {5264ms}  
BalloonEngine>>copyLoopFaster
         |        |      |          |            12.0% {5264ms}  
primitives
         |        |      |        12.6% {5527ms} NCLineMorph>>fullBounds
         |        |      |          12.0% {5264ms}  
NCLineMorph>>computeBounds
         |        |      |            6.3% {2764ms}  
NCLineMorph>>updateArrowContours
         |        |      |              |5.0% {2193ms}  
NCLineArrowGlyph>>openForLineWidth:
         |        |      |            2.7% {1184ms}  
NCLineMorph>>arrowForms
         |        |    16.4% {7194ms} SystemWindow(Morph)>>fullDrawOn:
         |        |      13.8% {6054ms}  
SystemWindow(Morph)>>drawSubmorphsOn:
         |        |        |13.7% {6010ms}  
FormCanvas(Canvas)>>fullDrawMorph:
         |        |        |  13.7% {6010ms}  
FormCanvas(Canvas)>>fullDraw:
         |        |        |    13.7% {6010ms}  
PasteUpMorph(Morph)>>fullDrawOn:
         |        |        |      12.6% {5527ms}  
PasteUpMorph>>drawSubmorphsOn:
         |        |        |        12.5% {5483ms}  
FormCanvas(Canvas)>>fullDrawMorph:
         |        |        |          12.4% {5440ms}  
FormCanvas(Canvas)>>fullDraw:
         |        |        |            8.1% {3553ms}  
NCAAConnectorMorph>>fullDrawOn:
         |        |        |              |7.8% {3422ms}  
NCAAConnectorMorph(Morph)>>drawSubmorphsOn:
         |        |        |              |  7.7% {3378ms}  
FormCanvas(Canvas)>>fullDrawMorph:
         |        |        |              |    7.7% {3378ms}  
FormCanvas(Canvas)>>fullDraw:
         |        |        |              |      7.7% {3378ms}  
NCLineMorph(Morph)>>fullDrawOn:
         |        |        |              |        6.7% {2939ms}  
FormCanvas(Canvas)>>drawMorph:
         |        |        |              |          6.7% {2939ms}  
FormCanvas(Canvas)>>draw:
         |        |        |              |            6.6% {2895ms}  
NCLineMorph>>drawOn:
         |        |        |              |              5.6% {2457ms}  
BalloonCanvas>>flush
         |        |        |              |                5.6% {2457ms}  
BalloonEngine>>flush
         |        |        |              |                  5.5%  
{2413ms} BalloonEngine>>copyBits
         |        |        |              |                    5.4%  
{2369ms} BalloonEngine>>copyLoopFaster
         |        |        |              |                      5.4%  
{2369ms} primitives
         |        |        |            4.4% {1930ms}  
NCUMLDiagramMorph(Morph)>>fullDrawOn:
         |        |        |              2.5% {1097ms}  
NCUMLDiagramMorph(Morph)>>drawSubmorphsOn:
         |        |        |                2.3% {1009ms}  
FormCanvas(Canvas)>>fullDrawMorph:
         |        |        |                  2.3% {1009ms}  
FormCanvas(Canvas)>>fullDraw:
         |        |        |                    2.2% {965ms}  
NCGrabbableDisplayTextMorph(Morph)>>fullDrawOn:
         |        |      2.2% {965ms} FormCanvas(Canvas)>>drawMorph:
         |        |        2.2% {965ms} FormCanvas(Canvas)>>draw:
         |        |          2.2% {965ms} SystemWindow(Morph)>>drawOn:
         |      3.2% {1404ms} WorldState>>forceDamageToScreen:
         |        3.2% {1404ms} DisplayScreen>>forceDamageToScreen:
         |          3.1% {1360ms} OrderedCollection>>do:
       31.9% {13994ms} PasteUpMorph>>runStepMethods
         |31.9% {13994ms} WorldState>>runStepMethodsIn:
         |  31.8% {13950ms} WorldState>>runLocalStepMethodsIn:
         |    30.7% {13467ms} StepMessage(MorphicAlarm)>>value:
         |      30.6% {13423ms} NCAAConnectorMorph(Morph)>>stepAt:
         |        28.8% {12634ms} NCLineEndConstraintMorph>>step
         |          24.3% {10660ms}  
NCLineEndConstraintMorph>>applyConstraint:
         |            |20.2% {8861ms} NCLineMorph>>verticesAt:put:
         |            |  |20.2% {8861ms} NCLineMorph>>setVertices:
         |            |  |  19.8% {8686ms} NCLineMorph>>computeBounds
         |            |  |    8.2% {3597ms}  
NCLineMorph>>updateArrowContours
         |            |  |      |6.4% {2807ms}  
NCLineArrowGlyph>>openForLineWidth:
         |            |  |      |  2.3% {1009ms}  
NCLineArrowGlyph(NCCurve)>>updateBounds
         |            |  |    4.8% {2106ms} NCLineMorph>>arrowForms
         |            |  |      2.4% {1053ms}  
BalloonCanvas>>drawGeneralBezierShape...rderWidth:borderColor:
         |            |3.9% {1711ms}  
NCLineEndConstraintMorph(Morph)>>center:
         |            |  3.8% {1667ms}  
NCLineEndConstraintMorph(Morph)>>position:
         |            |    2.1% {921ms} NCAAConnectorMorph>>layoutChanged
         |          3.5% {1535ms} NCLineEndConstraintMorph>>target
         |            3.1% {1360ms}  
NCLineEndConstraintMorph(NCConstraintMorph)>>targetPoint
         |              2.6% {1141ms}  
MessageSend>>valueWithEnoughArguments:
         |                2.5% {1097ms}  
NCLineEndConstraintMorph>>nearestPointToCenterOf:
         |                  2.4% {1053ms}  
NCUMLDiagramMorph(BorderedMorph)>>intersectionWithLineSegmentFromCenterT 
o:
         |                    2.4% {1053ms}  
NCUMLDiagramMorph(Morph)>>intersectionWithLineSegmentFromCenterTo:
         |                      2.2% {965ms}  
NCUMLDiagramMorph(Morph)>>firstIntersectionWithLineFrom:to:
       14.7% {6448ms} HandMorph>>processEvents
         8.8% {3860ms} MouseOverHandler>>processMouseOver:
           |7.4% {3246ms} HandMorph>>handleEvent:
           |  6.8% {2983ms} HandMorph>>sendMouseEvent:
           |    6.8% {2983ms} HandMorph>>sendEvent:focus:clear:
           |      6.5% {2851ms} PasteUpMorph(Morph)>>processEvent:
           |        6.4% {2807ms} PasteUpMorph>>processEvent:using:
           |          6.4% {2807ms}  
PasteUpMorph(Morph)>>processEvent:using:
           |            6.3% {2764ms}  
MorphicEventDispatcher>>dispatchEvent:with:
           |              6.2% {2720ms}  
MorphicEventDispatcher>>dispatchDefault:with:
           |                3.9% {1711ms}  
SystemWindow(Morph)>>processEvent:using:
           |                  3.0% {1316ms}  
MorphicEventDispatcher>>dispatchEvent:with:
           |                    2.9% {1272ms}  
MorphicEventDispatcher>>dispatchDefault:with:
           |                      2.2% {965ms}  
PasteUpMorph>>processEvent:using:
           |                        2.2% {965ms}  
PasteUpMorph(Morph)>>processEvent:using:
           |                          2.2% {965ms}  
MorphicEventDispatcher>>dispatchEvent:with:
           |                            2.2% {965ms}  
MorphicEventDispatcher>>dispatchDefault:with:
         3.8% {1667ms} HandMorph>>handleEvent:
           2.2% {965ms} HandMorph>>sendMouseEvent:
             2.2% {965ms} HandMorph>>sendEvent:focus:clear:
               2.2% {965ms} PasteUpMorph(Morph)>>processEvent:
                 2.2% {965ms} PasteUpMorph>>processEvent:using:
                   2.2% {965ms} PasteUpMorph(Morph)>>processEvent:using:
                     2.2% {965ms}  
MorphicEventDispatcher>>dispatchEvent:with:
                       2.2% {965ms}  
MorphicEventDispatcher>>dispatchDefault:with:

**Leaves**
17.7% {7764ms} BalloonEngine>>copyLoopFaster
3.4% {1491ms} OrderedCollection>>do:
3.1% {1360ms} Array(SequenceableCollection)>>do:
2.4% {1053ms} SmallInteger(Magnitude)>>max:
2.1% {921ms} NCAAConnectorMorph(Morph)>>hasExtension

**Memory**
	old			+849,332 bytes
	young		+42,564 bytes
	used		+891,896 bytes
	free		-891,896 bytes

**GCs**
	full			0 totalling 0ms (0.0% uptime)
	incr		1235 totalling 3,939ms (9.0% uptime), avg 3.0ms
	tenures		17 (avg 72 GCs/tenure)
	root table	0 overflows




More information about the Squeak-dev mailing list