PLEASE CHOOSE THE UP-TO-DATE MEASUREMENTS INSTEAD OF THESE! (Read the FAQ!) |
Compare the performance of Smalltalk GNU programs against some other language implementation.
For more information about the Smalltalk implementation we measured see ↓ about Smalltalk GNU.
| 1/2 1/3 1/4 Smalltalk GNU is better | ||||
|---|---|---|---|---|
| Programs | Time | Memory Use | Source Size | Reduced N |
| chameneos-redux | ||||
| regex-dna | ||||
| recursive | 1/4 | 4 | ± | 7 |
| nsieve | 1/3 | 1/3 | ± | |
| binary-trees | 1/2 | 5 | ± | 14 |
| fasta | 1/2 | 2 | ± | |
| spectral-norm | 1/2 | 3 | ± | |
| fannkuch | 1/2 | 3 | 2 | |
| n-body | ± | 2 | ± | |
| nsieve-bits | 2 | 2 | 3 | |
| partial-sums | 2 | 2 | ± | |
| mandelbrot | 2 | 2 | 2 | |
| pidigits | 5 | 61 | 2 | |
| sum-file | 6 | 2 | 2 | |
| k-nucleotide | 21 | ± | 3 | |
| reverse-complement | 35 | ± | 3 | |
± look at the measurements
| Program & Logs | CPU secs | Memory KB | Size B | Elapsed secs | ~ CPU Load |
|---|---|---|---|---|---|
| recursive N = 7 reduced workload | |||||
| Smalltalk GNU | 9.81 | 8,500 | 510 | ||
| Perl #2 | 36.28 | 2,080 | 380 | ||
| nsieve | |||||
| Smalltalk GNU #2 | 7.78 | 39,276 | 384 | ||
| Perl #2 | 25.45 | 121,904 | 290 | ||
| binary-trees N = 14 reduced workload | |||||
| Smalltalk GNU | 21.01 | 65,364 | 729 | ||
| Perl #2 | 41.76 | 13,128 | 541 | ||
| fasta | |||||
| Smalltalk GNU #2 | 486.08 | 3,820 | 1311 | ||
| Perl #4 | 950.04 | 1,872 | 934 | ||
| spectral-norm | |||||
| Smalltalk GNU | 2,193.84 | 6,192 | 476 | ||
| Perl #2 | 4,089.08 | 2,468 | 334 | ||
| fannkuch | |||||
| Smalltalk GNU | 539.45 | 3,860 | 777 | ||
| Perl | 855.72 | 1,492 | 348 | ||
| n-body | |||||
| Smalltalk GNU | 2,417.38 | 4,288 | 1657 | ||
| Perl | 1,697.59 | 1,936 | 1140 | ||
| nsieve-bits | |||||
| Smalltalk GNU | 157.76 | 8,160 | 733 | ||
| Perl | 100.18 | 4,004 | 253 | ||
| partial-sums | |||||
| Smalltalk GNU | 31.83 | 3,652 | 558 | ||
| Perl #3 | 17.41 | 1,476 | 389 | ||
| mandelbrot | |||||
| Smalltalk GNU #2 | 739.11 | 3,592 | 473 | ||
| Perl #2 | 403.20 | 1,724 | 311 | ||
| pidigits | |||||
| Smalltalk GNU | 19.27 | 154,732 | 905 | ||
| Perl #2 | 3.61 | 2,532 | 385 | ||
| sum-file | |||||
| Smalltalk GNU #3 | 111.39 | 3,560 | 178 | ||
| Perl | 18.17 | 1,468 | 84 | ||
| k-nucleotide | |||||
| Smalltalk GNU | 659.26 | 47,956 | 959 | ||
| Perl #2 | 32.07 | 42,816 | 359 | ||
| reverse-complement | |||||
| Smalltalk GNU | 69.04 | 49,124 | 750 | ||
| Perl #2 | 1.99 | 38,360 | 298 | ||
"Design Principles Behind Smalltalk" by Daniel Ingalls
GNU Smalltalk version 3.0.2
Home Page: GNU Smalltalk : The Smalltalk for those who can type
Download: Downloading GNU Smalltalk
--enable-jit was not available for this build
We've made the Smalltalk code a little more generic by abstracting out these implementation specific details, these are read from the command line before each script:
Object subclass: #Tests instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Shootout'! !Tests class methodsFor: 'platform'! arg ^Smalltalk arguments first asInteger! ! !Tests class methodsFor: 'platform'! stdin ^FileStream stdin! ! !Tests class methodsFor: 'platform'! stdinSpecial ^self stdin bufferSize: 4096! ! !Tests class methodsFor: 'platform'! stdout ^FileStream stdout! ! !Tests class methodsFor: 'platform'! stdoutSpecial ^self stdout bufferSize: 4096! ! !Stream methodsFor: 'platform'! print: number digits: decimalPlaces | n s | n := 0.5d0 * (10 raisedToInteger: decimalPlaces negated). s := ((number sign < 0) ifTrue: [number - n] ifFalse: [number + n]) printString. self nextPutAll: (s copyFrom: 1 to: (s indexOf: $.) + decimalPlaces)! ! !Stream methodsFor: 'platform'! print: number paddedTo: width | s | s := number printString. self nextPutAll: (String new: (width - s size) withAll: $ ), s! ! !Integer methodsFor: 'platform'! asFloatD ^self asFloat! !