[Q] Squeak to C code

goran.krampe at bluefish.se goran.krampe at bluefish.se
Thu May 22 12:34:07 UTC 2003


Hi Pablo!

Pablo Lopez <PLopez at temaiken.com.ar> wrote:
> Tks David... (That's a good approach)
> 
> However, i'll stick to Squeak and try to make that performance gap smaller..

Is it any particular thing you have a performance problem with? The way
to go about performance in the Squeak world is roughly like this:

1. Profile your code. Look at class comment of TimeProfileBrowser
2. Try to fix the methods that seem to be the easiest targets give the
profiling above.
3. Go back to step 1 and repeat a few times. :-)
4. If this doesn't give you enough performance - rethink the algorithms
used. Are you doing linear searching instead of using hashes? What
collections are you using? Is the code doing stuff multiple times
without the need for it - can you cache results? Have you asked the
squeak-dev list for help on *specific* performance issues with runnable
sample code? 
5. If you are *still* in trouble, you could perhaps try to find the
bottleneck and turn it into a Plugin. This means isolating a small part
of the code that you are having a problem with and rewriting it using
Slang (the subset of Smalltalk used in the plugins). Slang is "C with a
Smalltalk syntax" and the nice thing with Slang is that you have the
ability to write/run/debug it in Squeak just like Squeak code. But
again, it is quite primitive and you only want to work with the tight
bottlenecks in your code.

Another plus for plugins is that they are easily built and integrated
with the VM on all the platforms that Squeak runs on - see more about
VMMaker.

regards, Göran

PS. I haven't made a single plugin sofar so there are others with better
specific knowledge on that subject.



More information about the Squeak-dev mailing list