[Newbie] Morph class>>new
ducasse at iam.unibe.ch
Wed Apr 16 13:12:54 UTC 2003
we did some performance on initialize with andreas when he was visiting
us (and I should have taken time to profile that). We got with the
macro benchmark between 3% and 12% without ***Any*** optimization nor
analysis which means only putting
^ super new initialize
I think that a person good with the profiler could get really fast to
understand whay we got this 12%. We were also thinking to shortcut
scheme by redefine it on Array
So I would love to have that in Squeak. This was so well done in CLOS.
I have no time for that now but please give a try.
PS: Andreas was extremely surprised it would cost so less. It was fun
to see its reaction.
On Wednesday, April 16, 2003, at 02:58 PM, Stephen Pair wrote:
> Cees de Groot wrote:
>> On Wed, 2003-04-16 at 01:03, Richard A. O'Keefe wrote:
>>> ^self basicNew initialize
>>> "do nothing"
>>> then many classes would not need to define #new at all.
>> Exactly my idea. The only counter argument so far seems to be
>> performance - the extra 'dummy' message send to 'initialize' on
>> creation for *every* object, which is assumed to be expensive but
>> appears to be acceptably cheap.
>> Personally, I would vote pro this cleanup. If people find a case where
>> they don't want it (for performance reasons or whatever), they're free
>> to override this sensible default.
> It sounds to me like a sensible thing to do. The only thing I'd like
> to see is some measurements of the performance impact (after all,
> objects are creeated at a furious pace). Then, if the performance
> impact is measurable, figure out a way to optimize it to regain speed
> so that it is never necessary for someone to override the default just
> for the sake of performance.
> - Stephen
Prof. Dr. Stéphane DUCASSE
"if you knew today was your last day on earth, what would you do
different? ... especially if,
by doing something different, today might not be your last day on
"The best way to predict the future is to invent it..." Alan Kay.
Open Source Smalltalks: http://www.squeak.org,
Free books for Universities at
Free Online Book at
More information about the Squeak-dev