[squeak-dev] Rectangle swallow:

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Mon Dec 28 20:18:41 UTC 2009

2009/12/28 Igor Stasenko <siguctua at gmail.com>:
> 2009/12/27 Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com>:
>> I put an experimental SLICE in the inbox: let a Rectangle merge in
>> place (I called this swallow:)
>> This has two advantages:
>> - avoid repeated Object creation when we just want the gross result
>> - avoid closures writing to outer temps
>> IMHO, generalizing this kind of policy could have a measurable impact
>> on GUI speed.
>> However, this is against current policy to never change a Point nor
>> rectangle in place, so I let gurus judge if worth or not.
> Oh , you mean, that this method modifying the state of existing
> Rectangle instance,
> instead of producing new one?
> It is certaintly more optimal, especially in Morphic world. But it
> should be used with care,
> since sometimes you don't know, how many other morphs refer to same
> rectangle instance or
> where it came from.

Yes exactly that's the problem and that's why I ask.
I used it in a very controlled fashion over-protecting with a probably
unecessary copy in the preamble.
But you never know how the message will be used once you release it...
Anyway, some benchmark would be necessary before touching these bits...


>> cheers
>> Nicolas
> --
> Best regards,
> Igor Stasenko AKA sig.

More information about the Squeak-dev mailing list