[q]squeak is too slow?
tim at sumeru.stanford.edu
Wed Dec 8 04:51:38 UTC 2004
ÀÌÃá¼® <stonecold at jupiter.kaist.ac.kr> wrote:
> 'Something' is just array manipulations.
> Asuume that (j,k) are a matrix(30 by 30).
> For each (j,k) I want to compute sum of distance from (j,k) to all others.
> Finally we have to get a minimum among sums.
Well that explains where some of the time is going; array accessing in
Smalltalk is a bit more involved than in a jumped up PDP-8 assmebler
like C. For a start, it does bounds checking (no buffer over or under
runs - might be useful in, say avoiding IE like explooits).
Now, you might fairly point out that you don't feel a need for bounds
checking in such a loop but
a) tough luck ,you get them
b) in the general case you'd be a fool to trust that the arrays are
actually the size you anticipated.
Some other part of the system might have changed them by the time you
get to process them. Some nasty person might have used #become: to turn
them into OrderedCollections - or Processes! In Smalltalk the worst
that is likely to happen is a notifier with a bafflling message. In C
you'll be lucky to escape without letting the smoke out. (Don't laugh -
I've seen software turn a computer into a burning wreck)
Is Smalltalk slower than C for array processing of big lists of
homogeneous data? Yup. Is it too slow to do fascinating things? Take a
look at Croquet and decide.
Tim Rowledge, tim at sumeru.stanford.edu, http://sumeru.stanford.edu/tim
Klingon Code Warrior:- 7) "You question the worthiness of my Code?! I
should kill you where you stand!"
More information about the Squeak-dev