This page compares the following SML compiler versions.
There are tables for run time, code size, and compile time.
Setup
All benchmarks were compiled and run on a 2.6 GHz Celeron with 2G of RAM. The benchmarks were compiled with the default settings for all the compilers, except for Moscow ML, which was passed the -orthodox -standalone -toplevel switches. The Poly/ML executables were produced by use'ing the file, followed by a PolyML.commit. The SML/NJ executables were produced by wrapping the entire program in a local declaration whose body performs an SMLofNJ.exportFn.
For more details, or if you want to run the benchmarks yourself, please see the benchmark directory of our Sources.
All of the benchmarks are available for download from this page. Some of the benchmarks were obtained from the SML/NJ benchmark suite. Some of the benchmarks expect certain input files to exist in the DATA subdirectory.
Run-time ratio
The following table gives the ratio of the run time of each benchmark when compiled by another compiler to the run time when compiled by MLton. That is, the larger the number, the slower the generated code runs. A number larger than one indicates that the corresponding compiler produces code that runs more slowly than MLton. If an entry is *, that means that the corresponding compiler failed to compile the benchmark or that the benchmark failed to run.
benchmark | MLton | ML-Kit | MosML | Poly/ML | SML/NJ |
barnes-hut | 1.0 | * | * | * | 1.6 |
boyer | 1.0 | * | 10.1 | 1.9 | 3.1 |
checksum | 1.0 | * | * | * | * |
count-graphs | 1.0 | 7.3 | 60.7 | 4.2 | 3.8 |
DLXSimulator | 1.0 | * | * | * | * |
fft | 1.0 | 1.2 | * | 24.2 | 0.8 |
fib | 1.0 | 0.9 | 5.0 | 1.2 | 1.3 |
flat-array | 1.0 | 2.2 | 35.0 | 1041.6 | 13.4 |
hamlet | 1.0 | * | * | * | 3.1 |
imp-for | 1.0 | 2.8 | 63.0 | 5.1 | 5.6 |
knuth-bendix | 1.0 | * | 19.8 | 4.8 | 4.6 |
lexgen | 1.0 | 2.5 | 5.0 | 1.7 | 1.5 |
life | 1.0 | 1.7 | 30.6 | 7.7 | 1.4 |
logic | 1.0 | * | 9.4 | 1.2 | 2.1 |
mandelbrot | 1.0 | 4.2 | 34.0 | 51.1 | 1.3 |
matrix-multiply | 1.0 | 8.3 | 42.5 | 13.2 | 5.3 |
md5 | 1.0 | * | * | * | * |
merge | 1.0 | * | * | 1.1 | 7.9 |
mlyacc | 1.0 | 1.5 | 8.2 | 1.2 | 2.2 |
model-elimination | 1.0 | * | * | * | 2.6 |
mpuz | 1.0 | 2.3 | 78.2 | 4.6 | 4.1 |
nucleic | 1.0 | * | * | 23.5 | 0.8 |
output1 | 1.0 | 30.7 | 61.4 | 16.2 | 14.4 |
peek | 1.0 | 15.2 | 176.9 | 17.9 | 11.3 |
psdes-random | 1.0 | 5.0 | * | * | 2.7 |
ratio-regions | 1.0 | 2.0 | 34.7 | 2.1 | 5.4 |
ray | 1.0 | * | 14.8 | 22.3 | 0.8 |
raytrace | 1.0 | * | * | * | 3.3 |
simple | 1.0 | 1.7 | 19.3 | 7.3 | 2.4 |
smith-normal-form | 1.0 | * | * | * | >1000 |
tailfib | 1.0 | 1.0 | 51.9 | 3.2 | 1.4 |
tak | 1.0 | 1.2 | 17.0 | 1.3 | 2.0 |
tensor | 1.0 | * | * | * | 7.4 |
tsp | 1.0 | 3.4 | 31.8 | * | 17.7 |
tyan | 1.0 | * | 15.7 | 1.0 | 1.6 |
vector-concat | 1.0 | 1.2 | 20.4 | 2.0 | 20.4 |
vector-rev | 1.0 | 2.2 | 41.9 | 2.3 | 152.4 |
vliw | 1.0 | * | * | * | 2.5 |
wc-input1 | 1.0 | 11.1 | * | 7.5 | 17.2 |
wc-scanStream | 1.0 | 22.1 | * | 203.7 | 11.5 |
zebra | 1.0 | 3.9 | 30.2 | 3.4 | 8.5 |
zern | 1.0 | * | * | * | 2.6 |
Note: for SML/NJ, the smith-normal-form benchmark was killed after running for over 25,000 seconds.
Code size
The following table gives the code size of each benchmark in bytes. The size for MLton and the ML Kit is the sum of text and data for the standalone executable as reported by size. The size for Moscow ML is the size in bytes of the executable a.out. The size for Poly/ML is the difference in size of the database before the session start and after the commit. The size for SML/NJ is the size of the heap file created by exportFn and does not include the size of the SML/NJ runtime system (approximately 100K). A * in an entry means that the compiler failed to compile the benchmark.
benchmark | MLton | ML-Kit | MosML | Poly/ML | SML/NJ |
barnes-hut | 103,231 | * | * | * | 433,216 |
boyer | 138,518 | 163,204 | 116,300 | 122,880 | 526,376 |
checksum | 52,794 | * | * | * | * |
count-graphs | 66,838 | 84,124 | 84,613 | 98,304 | 454,776 |
DLXSimulator | 129,398 | * | * | * | * |
fft | 64,797 | 80,240 | 84,046 | 65,536 | 434,256 |
fib | 47,738 | 18,588 | 79,892 | 49,152 | 415,488 |
flat-array | 47,762 | 23,820 | 80,034 | 49,152 | 410,680 |
hamlet | 1,256,813 | * | * | * | 1,412,360 |
imp-for | 47,626 | 19,372 | 80,040 | 57,344 | 400,424 |
knuth-bendix | 109,126 | 93,400 | 88,439 | 180,224 | 431,144 |
lexgen | 203,559 | 208,332 | 104,883 | 196,608 | 501,824 |
life | 66,130 | 78,084 | 83,390 | 65,536 | 414,760 |
logic | 106,614 | 116,880 | 87,251 | 114,688 | 440,360 |
mandelbrot | 47,690 | 77,004 | 81,340 | 57,344 | 404,520 |
matrix-multiply | 49,181 | 87,016 | 82,417 | 57,344 | 435,256 |
md5 | 77,646 | * | * | * | * |
merge | 49,318 | 24,296 | 80,090 | 49,152 | 400,432 |
mlyacc | 507,431 | 473,748 | 148,286 | 2,850,816 | 820,336 |
model-elimination | 638,084 | * | * | * | 1,009,880 |
mpuz | 50,594 | 73,232 | 82,382 | 81,920 | 408,616 |
nucleic | 199,181 | 258,552 | * | 221,184 | 487,480 |
output1 | 80,720 | 63,336 | 80,187 | 49,152 | 399,400 |
peek | 76,302 | 62,092 | 81,621 | 57,344 | 403,544 |
psdes-random | 48,402 | 25,196 | * | * | 421,944 |
ratio-regions | 73,914 | 95,924 | 87,482 | 73,728 | 443,448 |
ray | 183,243 | 108,848 | 89,859 | 147,456 | 493,712 |
raytrace | 265,332 | * | * | * | 636,112 |
simple | 222,914 | 192,032 | 94,396 | 475,136 | 756,840 |
smith-normal-form | 181,686 | * | * | 131,072 | 558,224 |
tailfib | 47,434 | 18,804 | 79,943 | 57,344 | 399,400 |
tak | 47,818 | 18,580 | 79,908 | 57,344 | 411,392 |
tensor | 97,677 | * | * | * | 450,672 |
tsp | 82,190 | 97,716 | 86,146 | * | 425,024 |
tyan | 134,910 | 137,800 | 91,586 | 196,608 | 477,272 |
vector-concat | 49,018 | 23,924 | 80,194 | 49,152 | 410,680 |
vector-rev | 48,246 | 24,104 | 80,078 | 57,344 | 410,680 |
vliw | 393,762 | * | * | * | 731,304 |
wc-input1 | 101,850 | 129,212 | 85,771 | 49,152 | 404,520 |
wc-scanStream | 109,106 | 129,708 | 85,947 | 49,152 | 405,544 |
zebra | 141,146 | 41,532 | 83,422 | 90,112 | 419,896 |
zern | 91,087 | * | * | * | 479,384 |
Compile time
The following table gives the compile time of each benchmark in seconds. A * in an entry means that the compiler failed to compile the benchmark.
benchmark | MLton | ML-Kit | MosML | Poly/ML | SML/NJ |
barnes-hut | 8.28 | * | * | * | 1.37 |
boyer | 8.14 | 8.99 | 0.39 | 0.12 | 3.20 |
checksum | 5.45 | * | * | * | * |
count-graphs | 6.12 | 2.06 | 0.14 | 0.05 | 0.90 |
DLXSimulator | 9.81 | * | * | * | * |
fft | 5.95 | 1.32 | 0.11 | 0.05 | 0.69 |
fib | 5.45 | 0.60 | 0.05 | 0.02 | 0.22 |
flat-array | 5.33 | 0.61 | 0.04 | 0.01 | 0.25 |
hamlet | 85.70 | * | * | * | 88.87 |
imp-for | 5.37 | 0.73 | 0.05 | 0.01 | 0.25 |
knuth-bendix | 7.09 | 4.11 | 0.19 | 0.12 | 1.60 |
lexgen | 11.02 | 7.21 | 0.40 | 0.26 | 3.63 |
life | 5.84 | 2.16 | 0.10 | 0.04 | 0.64 |
logic | 7.02 | 4.82 | 0.22 | 0.09 | 1.68 |
mandelbrot | 5.41 | 0.75 | 0.06 | 0.02 | 0.29 |
matrix-multiply | 5.39 | 0.77 | 0.06 | 0.01 | 0.30 |
md5 | 6.01 | * | * | * | * |
merge | 5.41 | 0.62 | 0.06 | 0.02 | 0.26 |
mlyacc | 24.70 | 40.69 | 3.35 | 1.08 | 18.04 |
model-elimination | 25.04 | * | * | * | 28.79 |
mpuz | 5.41 | 1.07 | 0.07 | 0.03 | 0.45 |
nucleic | 14.24 | 24.79 | * | 0.36 | 2.78 |
output1 | 6.05 | 0.68 | 0.05 | 0.01 | 0.23 |
peek | 6.04 | 0.70 | 0.05 | 0.02 | 0.25 |
psdes-random | 5.39 | 0.75 | * | * | 64.13 |
ratio-regions | 6.63 | 4.02 | 0.21 | 0.11 | 1.50 |
ray | 9.51 | 3.02 | 0.15 | 0.08 | 1.03 |
raytrace | 13.92 | * | * | * | 5.08 |
simple | 11.40 | 13.19 | 0.43 | 0.21 | 3.76 |
smith-normal-form | 8.90 | * | * | 0.10 | 2.25 |
tailfib | 5.35 | 0.64 | 0.05 | 0.02 | 0.24 |
tak | 5.36 | 0.62 | 0.05 | 0.01 | 0.22 |
tensor | 8.75 | * | * | * | 2.81 |
tsp | 6.50 | 1.93 | 0.15 | * | 0.66 |
tyan | 8.86 | 6.25 | 0.30 | 0.17 | 2.28 |
vector-concat | 5.52 | 0.68 | 0.05 | 0.01 | 0.25 |
vector-rev | 5.33 | 0.64 | 0.05 | 0.02 | 0.26 |
vliw | 18.28 | * | * | * | 13.12 |
wc-input1 | 6.85 | 0.68 | 0.07 | 0.02 | 0.27 |
wc-scanStream | 7.07 | 0.69 | 0.06 | 0.02 | 0.29 |
zebra | 8.57 | 2.30 | 0.09 | 0.04 | 0.78 |
zern | 6.20 | * | * | * | 0.65 |