I had a look at the Great Computer Language Shootout site this morning, since there's some VW Smalltalk code (and results) posted there. The comparison I was drawn to happened to be with Mono based C# (based on a comment here). There are some issues with the comparison, however:
- Have a look at this test - scroll down, and look at the execution. The source code is filed-in, and then the test is executed. That slows things down.
- Have a look at the C# version - the code is compiled, and then executed.
- A fairer test would separate the load/execute in the Smalltalk test
So I did the same thing I did with Troy's post over the weekend - I downloaded the code and did some local shaking out. To get it loaded, I had to create a namespace called ComputerLanguageShootout first, and also create a class named Benchmarks. Once that was done, I could file-in the code.
Then, I tried this:
"File in code, then execute"
Time millisecondsToRun: ['nbody.st' asFilename fileIn.
Smalltalk.ComputerLanguageShootout.Benchmarks nbody: 1000000].
That times the execution of two steps - loading the code, and then executing the test with a million repetitions (the number used on the shootout site). The result? 15,045 milliseconds (on my hardware - note that comparisons are pointless across variant hardware/OS combos). Then I tried executing the code with it already loaded -
"File in code, then execute"
Time millisecondsToRun: [Smalltalk.ComputerLanguageShootout.Benchmarks
nbody: 1000000].
That ran in 11.818 ms. I repeated the process a few times to make sure that those numbers weren't outliers, and they weren't. So on my hardware, you get 4 extra seconds for loading and compiling the code - and in the posted Mono test, the compilation step is separate. So it's not really an Apples/Apples test.
On the Smalltalk IRC channel, it was pointed out that a lot of the other language tests vary just as widely. Ultimately, the shootout site simply isn't doing good cross language tests.