[squeak-dev] Object>>is:

Igor Stasenko siguctua at gmail.com
Fri Feb 11 18:29:34 UTC 2011

On 11 February 2011 17:02, Levente Uzonyi <leves at elte.hu> wrote:
> On Fri, 11 Feb 2011, Igor Stasenko wrote:
>> On 11 February 2011 15:57, Levente Uzonyi <leves at elte.hu> wrote:
>>> On Fri, 11 Feb 2011, Igor Stasenko wrote:
>>>> Since this method is hardly useful from any other code but morphic,
>>>> then what it does in SmalltalkImage?
>>> That's a good question, but unrelated to this thread.
>>>> It should belong to UI universe.. and UI uninverse should know how to
>>>> tell all morphs to do that cleanup.. and then you don't need anything
>>>> related to it in Object protocol.
>>>> It makes no sense asking every object in system in a way like that.
>>> It's a lot faster asking all objects, than asking only the Morphs.
>> Morphs are just a subset of all objects.. So, please tell me how
>> sending a message to all objects could be faster than sending message
>> to all morphs? :)
> I guess you didn't think about the problem. How do you select all morphs?
you can do something like:
  World blahblah...
I am sure, if you look deeply there is a way to iterate over all submorphs tree.

And don't say that it will be slower than iterating over all objects
in object memory.

But even if you do, then why not iterating over morphs , so you don't
have to use #isMorph

Morph allSubInstancesDo: ...

>>>> So, all you need is to think a bit more broadly in a sense, how to
>>>> improve system and remove crappy patterns from use,
>>>> but not blindly replace one pattern by another , which replacing one
>>>> flood with another.
>>> If you can show a pattern for this which has comparable performance with
>>> the
>>> current implementation, then I'm all ears.
>> Since when performance became the only criteria for reasoning about
>> implementation quality?
> Who said it's the only criteria (besides you)?
> Btw, the previous implementation of this method was slow. It annoyed me so
> much that I changed it to the current implememtation which uses
> allObjectsDo: and is 22x faster for a Trunk image.

Why then to not change the implementation?
Why you fighting with imlementation being slow, without getting
interested why it implemented in such manner,
which is the main reason why its so slow.

Did you asked yourself, why cleaning up the undo commands in morphs is
responsibility of SmalltalkImage class ??
Why it is not responsibility of morphic world/project.

So, yeah.. keep fighting with consequences instead of dealing with cause.

> Levente

Best regards,
Igor Stasenko AKA sig.

More information about the Squeak-dev mailing list