On Fri, 30 Mar 2001 ajh18@cornell.edu wrote:
Tom tmb@lumo.com wrote:
I was curious where the various implementations of a few dynamic languages stand now and I implemented some simple benchmarks. You can find them at http://www.lumo.com/squeak-bench/ In general, Squeak does pretty well compared to Python.
But why does Squeak do poorly compared to Java (even without JIT)? Is it mainly because Java has static typing and no escaping method contexts (blocks)?
I don't think it does *poorly* by and large. For the first three tests, it's within a factor of three. Now considering that Squeak's bytecode interpreter *isn't* optimized for speed, but for being reasonably speedy while remaining comprehensible to mere mortals (i.e., *not* doing tricky stuff), I think it does quite well. (Note that this is a design goal of the Python VM too.)
Now, speaking totally randomly, I'll point out that whenever you use primative types in Java, especially numerics, you'd *better* see a big boost in speed, since you won't have to unboxed them. In inner loops this can make a big difference (which I hypothozie is why the mandelbrot tests show a bigger difference).
Note that, in squeak, you can achieve some of this gain by using IntegerArrays and FloatArrays.
It'd be interesting to see these tests ported to Dolphin Smalltalk (which has a highly tuned intepreter) and VisualWorks (which has a big ole beefy JIT).
Cheers, Bijan Parsia.