/mobile Handheld Friendly website
OUT-OF-DATE! Read http://shootout.alioth.debian.org/ |
This chart shows 3 comparisons - Time-used, Memory-used and Code-used ~ speed and size.
Each chart bar shows, for one unidentified benchmark, how much the fastest Clean program used compared to the fastest C++ GNU g++ program.
Look at speed another way - look at a box plot of Time-used data.
This table shows 3 comparisons - Time-used, Memory-used and Code-used ~ speed and size.
Each table row shows, for one named benchmark, how much the fastest Clean program used compared to the fastest C++ GNU g++ program.
| Clean used what fraction? used how many times more? | ||||
|---|---|---|---|---|
| Benchmark | Time | Memory | Code | |
| binary-trees | ± | 2× | ± | |
| nsieve | ± | 2× | ± | |
| partial-sums | ± | 1/2 | ± | |
| spectral-norm | ± | 2× | ± | |
| n-body | ± | 1/2 | ± | |
| fasta | 2× | 4× | ± | |
| recursive | 2× | 1/2 | ± | |
| mandelbrot | 2× | 1/2 | 1/2 | |
| nsieve-bits | 2× | ± | ± | |
| k-nucleotide | 2× | 8× | ± | |
| pidigits | 2× | 2× | ± | |
| reverse-complement | 2× | 3× | ± | |
| Clean used what fraction? used how many times more? | |||||||
|---|---|---|---|---|---|---|---|
| Time-used | |- | |--- | 25% | median | 75% | ---| | -| |
| (CPU secs) | ± | ± | ± | 2× | 2× | 2× | 2× |
± read the measurements and then read the program source code.
This table shows 5 measurements - CPU Time, Elapsed Time, Memory, Code and ≈ CPU Load ~ speed and size.
For each named benchmark, measurements of the fastest Clean program are shown for comparison against measurements of the fastest C++ GNU g++ program.
| Program Source Code | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
|---|---|---|---|---|---|
| binary-trees | |||||
| Clean | 3.98 | 16,868 | 539 | ||
| C++ GNU g++ | 4.47 | 6,996 | 541 | ||
| nsieve | |||||
| Clean | 2.08 | 9,324 | 394 | ||
| C++ GNU g++ | 2.08 | 5,764 | 313 | ||
| partial-sums | |||||
| Clean | 4.18 | 508 | 577 | ||
| C++ GNU g++ | 4.05 | 852 | 531 | ||
| spectral-norm | |||||
| Clean | 27.32 | 1,404 | 572 | ||
| C++ GNU g++ | 23.84 | 900 | 442 | ||
| n-body | |||||
| Clean | 17.28 | 520 | 1587 | ||
| C++ GNU g++ | 14.62 | 932 | 1705 | ||
| fasta | |||||
| Clean | 28.77 | 2,820 | 1420 | ||
| C++ GNU g++ | 18.72 | 788 | 1248 | ||
| recursive | |||||
| Clean | 3.80 | 596 | 422 | ||
| C++ GNU g++ | 2.40 | 1,008 | 566 | ||
| mandelbrot | |||||
| Clean | 4.96 | 472 | 506 | ||
| C++ GNU g++ | 3.02 | 896 | 1097 | ||
| nsieve-bits | |||||
| Clean | 6.41 | 4,844 | 464 | ||
| C++ GNU g++ | 3.86 | 3,316 | 494 | ||
| k-nucleotide | |||||
| Clean | 13.61 | 78,032 | 1511 | ||
| C++ GNU g++ | 7.46 | 9,304 | 1380 | ||
| pidigits | |||||
| Clean | 3.42 | 2,624 | 563 | ||
| C++ GNU g++ | 1.66 | 1,052 | 652 | ||
| reverse-complement | |||||
| Clean | 1.20 | 43,080 | 834 | ||
| C++ GNU g++ | 0.54 | 13,288 | 810 | ||
| regex-dna | |||||
| C++ GNU g++ | 1.14 | 2,960 | 1588 | ||
Remember - those are just the fastest Clean and C++ GNU g++ programs measured on this OS/machine. Check if there are other implementations of these benchmark programs for Clean.
Maybe one of those other Clean programs is fastest on a different OS/machine.
Remember - those are just the fastest Clean and C++ GNU g++ programs measured on this OS/machine. Check if there are faster implementations of these benchmark programs for other programming languages.
Maybe one of those other programs is fastest on a different OS/machine.
Clean 2.2
Home Page: Clean
Download: Download Clean
We've made the Clean programs a little more obvious by providing these library functions:
import StdEnv, ArgEnv // The first commandline arg (if it will convert to Int) otherwise 1 argi :: Int argi = if (argAsInt <= 0) 1 argAsInt where argv = getCommandLine argAsInt = if (size argv == 2) (toInt argv.[1]) 1 // Round to n decimal places & convert to String toStringWith :: !.Int !.Real -> {#Char} toStringWith n a # z = 10.0 ^(~ (toReal n)) # x = (0.5 * z) + abs a # (s,exp) = ndigits x z (entier x) (nsign a) 0 # (s,exp) = nzeros s exp True = s where nsign x = if (x<0.0) "-" "" ndigits x z i s exp | x<z = (s,exp) # x = (x - toReal i)*10.0 = ndigits x (z*10.0) (entier x) ((if (exp == -1)(s +++ ".") s) +++ toString i) (exp-1) nzeros s exp point | exp < ~n = (s,exp) | (exp == -1 && point) = nzeros (s +++ ".") exp False = nzeros (s +++ "0") (exp-1) point