Morphic slowness (was Re: Does *anyone* use MVC?)
Andreas Raab
Andreas.Raab at gmx.de
Fri Aug 2 00:47:16 UTC 2002
Dan,
> >====
> > | 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.
>
> The whole wantsSteps mechanism is a crock IMO (at least as it
> is implemented right now). This performance bug is only a
> mild problem. It is a time-bomb waiting for any innocent
> newbie to add #step to object. I have to admit fault here,
> as I've worked on it without fixing it several times in the past.
Just a little note on the above: None of the #startSteppingsubmorphsOf:
is necessary. I got all of this fixed (since it was called all over the
unlikeliest of places and still didn't work) in the #intoWorld: protocol
which gets called whenever morphs show up in a world and not just by
random chance (note that intoWorld: doesn't even show up, which means
that startSteppingOf: is called repeatededly and for no reason
whatsoever, hah!). E.g., startSteppingSubmorphsOf: is simply OBSOLETE
and can be removed without any worries whatsoever. So the first thing to
do is to make that method a no-op (which will bring down the above to
exactly zero percent of the overall time). Then...
> (*) The obvious solution I propose here is to eschew
> gratuitous intelligence, and declare that wantsSteps (like
> handlesMouseDown:, etc) should be a simple ^true (or simple
> local (non-hierarchy-traversing) logic), added in the
> hierarchy wherever step is added, and defaulted to ^false in
> Morph. The extension to SystemWindow models can be equally simple.
... if you still want to do this all you need is to call the initial
step from intoWorld: which is both, simple and efficient (since you
won't even bother to register a morph with the stepping machinery if it
returns false). But actually I seriously doubt that you really need it-
it gets called if and ONLY if the morph shows up in the world and I've
never seen it in any tallies I have run.
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|