Real closures

Philippe Marschall philippe.marschall at gmail.com
Sun Oct 8 08:30:39 UTC 2006


2006/10/8, Klaus D. Witzel <klaus.witzel at cobss.com>:
> On Sun, 08 Oct 2006 00:35:19 +0200, Andreas Raab wrote:
> > Klaus D. Witzel wrote:
> >> Andreas, have you looked at the implementor of #createBlock: and the
> >> associated BlockClosure class (both are in the 3.9 image). The latter
> >> has a class comment (I know, that's a rarity ;-) On the instance side,
> >> there's a message category #evaluating, equally interesting.
> >
> > I have not. Thanks for pointing it out.
> >
> >> I doubt that you will ever use BlockClosure in one of your performance
> >> sensitive projects, especially when the messages you need are in
> >> {#value. #value:} etc.
> >
> > Not sure about this. There are issues with our current contexts, BIG
> > issues. So big that I'd very seriously consider accepting a slowdown in
> > exchange to fixing these problems.
>
> :) Mathieu: hurry up, potential users are waiting for sensible performance
> comparisions :) Are there already benchmarks available for exhibiting the
> slowdown experienced with instance variables accessed from BlockClosures?

You can do some micro-benchmarks for closures vs. blocks. And they
don't look good. They also slow down cases where you don't need full
block clousres and what VW calls a clean block would do. Probably
primitive 189 was not added.

http://minnow.cc.gatech.edu/squeak/ClosureCompiler
http://lists.squeakfoundation.org/pipermail/squeak-dev/2003-April/056833.html

[(1 to: 1000000) do: [:i | i]] timeToRun
non-closure mode: 240 ms
closure mode: 1660 ms

Philippe

>
>



More information about the Squeak-dev mailing list