tinyBenchmarks on PocketSmalltalk [ was Re: Interesting new target with Palm OS]

Mark van Gulik ghoul6 at home.net
Tue Oct 24 06:35:22 UTC 2000


> "Mark van Gulik" <ghoul6 at home.net> is widely believed to have written:
>
>> Eric, tsk, tsk.  My Atari ST Smalltalk (circa 1988) was doing around 10,000
>> bytecodes/sec on an 8 MHz Atari 1040ST with 1 MB of RAM.  Have you
>> considered abandoning the concept of a VM coded entirely in C?  Much of the
>> VM I constructed was coded in good ol' 68000 assembly (using inlined asm{}
>> code in MegaMax C).  Instead of their pathetic switch statement I used the
>> following dispatch loop...
>
> Dear oh dear. My port of BrouHaHa runing on an 8MhzARM2 (no cache, not
> even an instruction prefetch, $Mhz memory bus, no video memory) of the
> same vintage was running around 80-100,000 bytecodes/sec; ie 85-90%
> Dorado, somewhat dependent on the benchmark in use. And, to be honset,
> the phase of the moon when the vm was compiled.
> All very ordinary (sorry, Eliot) C code, run through  a not terribly
> wonderful (by modern standards) compiler. Well, except for the Bitblt,
> which was self compiling/annealing machine code with rapid special case
> detection.
>
> Good algorithms beat clever tricks 9 times out of 10. And in the tenth
> case, you can use the clever trick to help you discover a better
> algorithm.

Oh, gawd, I would never use self-modifying code on a modern processor (note
that the Palm's 68000 variant is not really modern in my mind)!  Also, I
hadn't researched *any* of the wonderful papers on VM optimizations yet.
Sometimes you learn more when you try it before reading about how to do it.
Then you *really* understand the pitfalls that the authors discuss.

As for using the BrouHaHa technique on the Palm, well, I think the target
VM+image footprint would be considerably bigger than the current 50K.

Oh yeah, this wasn't a Smalltalk-80 VM.  I bootstrapped it pretty much from
dirt all the way up to the beautiful mud that I ended up with.  I had to
build a ST->C "bootstrap" compiler that produced Smalltalk methods by
directly fiddling with memory, and then I bootstrapped the metacircular
compiler on top of it.  Quite a lot of fun, and I highly recommend it to
anyone with a thousand hours of free time and a masochistic streak.





More information about the Squeak-dev mailing list