Iteration Speed, Collections, and speed

Mark Mullin mark at vibrant3d.com
Wed Jan 30 15:49:50 UTC 2002


OK, I've gone and put my foot in it, I make one or two little comments about
iterators and people just jump all over my case   :-)

What I mean to say is that for iterated collections such as ordered
collection, the process of adding and searching the collection is
significantly more expensive than in a lower level compiled language such as
C++.  I'm not denying the benefits of 1st class oop, garbage collection, or
all the other great things I get, I'm just observing on a performance
number.

What this means in using Squeak is that you can't opt out to the C++ dumb
ass solution of "I got a list of 10K items, I'll just grovel through them to
find the one I want."  What is ignorable in C++ is a slow mover in
Smalltalk.

I admit that there are channels in the squeak process that are much swifter.
In many cases we elect to use Dictionaries, they do what we need, and are in
general much much faster for interactive interface support, at least when
you've got lists that include every known US traded ticker symbol.  Some
routines, such as sort are nice and snappy.  I didn't know about mapping
read and write streams over a collection, I will have to try it.

But as the original observation was mine, I was only stating that languages
are tools, and as such, each tends to be optimized for specific
applications.  What makes a language powerful for a wide range of
applications is not the PL/1 approach of "here's my 40 pound function
manual", instead it's the ability to extend the underlying system to bring
in specialists to deal with special needs.  I'd never write a full real time
OS in squeak.  On the other hand, Squeak makes it possible to write
components you need for a real time os, plug em all into squeak, and then
use squeak to interact with the OS. Squeak does what it does well, the
plugins do what they do well, and the only real nightmare is the fact that
you're going to have to bridge manually.  A modified IDL for squeak to
support plugins would be awesomely cool, if anyone is feeling exceptionally
bored.

Anyway, thats my 2c.  Squeaks great, we've completely chucked Java, we're
certainly not knocking it.  Just observing that one thing that makes it
great is that where it isn't, you can wire in low level components to be
great at some one thing.  Squeak is a deliberate genuius, plugins are
hyperactive idiot savants.

Mark





More information about the Squeak-dev mailing list