From: David Rush <firstname.lastname@example.org>
Subject: Surprising performance results (or Larceny Rocks!)
Date: 26 Jun 2001 18:40:19 +0100
User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Channel Islands)
Last night I finally got a Stalin version of a very compute-bound
program built (Yay!). I decided that, just for grins, I would
benchmark it against several of the other Scheme implementations I
have lying around (At last count I had 9 installed on my system).
The program computes the distance histogram of a list of words: that
is to say it calculates the string edit distance between all pairs of
words in the list. The list is originally read from a file (I've been
processing /usr/dict/words). This is an n-squared problem for n being
the number of words in the list and n^4 in the full text length.
For my benchmark I used 1000 words randomly culled from
/usr/dict/words on Solaris 2.6. All the code was run on an unladen
swallow^W Sun Ultra-60 running Solaris 2.8
And the winner is: Larceny!
larceny: 97.30u 0.29s 1:37.73 99.8%
stalin: 113.03u 0.04s 1:53.13 99.9%
bigloo: 235.63u 0.21s 3:56.04 99.9%
chicken: 410.29u 3.80s 6:54.17 99.9%
PLT (bytecode): 689.90u 0.67s 11:30.64 99.9%
My theory as to why:
The code is written in a fairly naive fashion. In particular it is
allocation-intensive (I allocate the full DP array for each distance
calculation rather than reusing/resizing a single array), giving an
edge to Larceny and it's advanced collection techniques over Stalin
and Bigloo which use the Boehm collector. Chicken's performance was
somewhat disappointing, but I'm not familiar enough with the
implementation to understand it's characteristics. I think that PLT
would be rather faster if I compiled it to native, but I haven't had
the time to figure that one out yet.
If anyone's interested, I'll post the code and dataset on the S2 web
site (I did the multi-platforming with S2's support for SRFI-0 and
modules) so you can check for yourselves.
In a tight spot, you trust your ship or your rifle to get you through,
so you refer to her affectionately and with respect. Your computer? It
would just as soon reboot YOU if it could. Nasty, unreliable,
ungrateful wretches, they are. -- Mike Jackmin (on sci.crypt)
Last modified: Tue Jun 10 21:11:28 IST 2003