This page compares the performance of the following SML compilers on a range of benchmarks.
There are tables for run time, compile time, and code size.
Setup
All benchmarks were compiled and run on a 1.6 GHz dual Athlon with 4G 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 useing 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 the MLton 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 | Moscow-ML | Poly/ML | SML/NJ |
barnes-hut | 1.0 | * | * | * | 1.1 |
boyer | 1.0 | * | 9.0 | 2.3 | 3.0 |
checksum | 1.0 | * | * | * | * |
count-graphs | 1.0 | 7.6 | 44.6 | 7.8 | 2.9 |
DLXSimulator | 1.0 | * | * | * | * |
fft | 1.0 | 2.7 | * | 46.4 | 1.0 |
fib | 1.0 | 1.3 | 5.4 | 1.0 | 1.3 |
flat-array | 1.0 | 1.4 | 10.8 | 130.1 | 4.2 |
hamlet | 1.0 | * | * | * | 2.2 |
imp-for | 1.0 | 4.2 | 66.1 | 10.7 | 6.0 |
knuth-bendix | 1.0 | * | 18.6 | 8.5 | 3.6 |
lexgen | 1.0 | 2.2 | 6.2 | 2.1 | 1.7 |
life | 1.0 | 2.8 | 25.9 | 10.2 | 1.5 |
logic | 1.0 | * | 6.6 | 1.5 | 1.1 |
mandelbrot | 1.0 | 13.9 | 45.5 | 71.3 | 1.5 |
matrix-multiply | 1.0 | 5.3 | 49.7 | 16.0 | 5.2 |
md5 | 1.0 | * | * | * | * |
merge | 1.0 | * | * | 1.5 | 5.8 |
mlyacc | 1.0 | * | 6.2 | 1.3 | 1.4 |
model-elimination | 1.0 | * | * | * | 1.7 |
mpuz | 1.0 | 2.5 | 53.3 | 5.5 | 3.4 |
nucleic | 1.0 | * | * | 22.9 | 0.6 |
output1 | 1.0 | 20.9 | 33.2 | 3.1 | 7.2 |
peek | 1.0 | 21.5 | 127.2 | 20.8 | 15.7 |
psdes-random | 1.0 | 7.7 | * | * | 3.4 |
ratio-regions | 1.0 | 2.2 | 25.7 | 2.8 | 4.8 |
ray | 1.0 | * | 22.4 | 35.8 | 1.4 |
raytrace | 1.0 | * | * | * | 2.8 |
simple | 1.0 | 1.9 | 14.4 | 7.4 | 1.6 |
smith-normal-form | 1.0 | * | * | * | >3000 |
tailfib | 1.0 | 1.3 | 35.5 | 2.4 | 2.4 |
tak | 1.0 | 2.4 | 9.6 | 0.8 | 1.6 |
tensor | 1.0 | * | * | * | 15.6 |
tsp | 1.0 | 3.4 | 25.9 | * | 56.7 |
tyan | 1.0 | * | 14.0 | 1.6 | 0.9 |
vector-concat | 1.0 | 1.7 | 16.4 | 1.7 | 9.6 |
vector-rev | 1.0 | 2.1 | 21.8 | 3.0 | 73.0 |
vliw | 1.0 | * | * | * | 1.3 |
wc-input1 | 1.0 | 14.8 | * | 6.6 | 8.7 |
wc-scanStream | 1.0 | 21.4 | * | 352.5 | 9.4 |
zebra | 1.0 | 7.0 | 30.6 | 7.2 | 8.6 |
zern | 1.0 | * | * | * | 2.8 |
Note: for SML/NJ, the smith-normal-form benchmark was killed after running for over 60,000 seconds.
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 | Moscow-ML | Poly/ML | SML/NJ |
barnes-hut | 7.06 | * | * | * | 1.09 |
boyer | 8.08 | 9.73 | 0.39 | 0.14 | 3.46 |
checksum | 4.96 | * | * | * | * |
count-graphs | 5.73 | 2.17 | 0.13 | 0.08 | 0.72 |
DLXSimulator | 7.67 | * | * | * | * |
fft | 5.00 | 1.54 | 0.12 | 0.06 | 0.66 |
fib | 4.67 | 0.91 | 0.04 | 0.03 | 0.16 |
flat-array | 4.60 | 0.91 | 0.03 | 0.02 | 0.18 |
hamlet | 46.86 | * | * | * | 53.12 |
imp-for | 4.63 | 0.99 | 0.04 | 0.02 | 0.19 |
knuth-bendix | 6.12 | 4.21 | 0.18 | 0.15 | 1.36 |
lexgen | 9.09 | 6.47 | 0.38 | 0.33 | 3.22 |
life | 5.09 | 2.43 | 0.09 | 0.07 | 0.53 |
logic | 6.52 | 4.77 | 0.21 | 0.11 | 1.43 |
mandelbrot | 4.63 | 0.97 | 0.05 | 0.03 | 0.23 |
matrix-multiply | 4.68 | 1.03 | 0.06 | 0.03 | 0.26 |
md5 | 5.26 | * | * | * | * |
merge | 4.64 | 0.93 | 0.07 | 0.01 | 0.24 |
mlyacc | 22.42 | 36.94 | 3.63 | 1.45 | 14.63 |
model-elimination | 23.07 | * | * | * | 24.06 |
mpuz | 4.75 | 1.27 | 0.06 | 0.04 | 0.35 |
nucleic | 65.13 | 31.26 | * | 0.48 | 2.56 |
output1 | 5.28 | 0.94 | 0.04 | 0.02 | 0.17 |
peek | 5.19 | 0.97 | 0.04 | 0.03 | 0.19 |
psdes-random | 4.65 | 0.99 | * | * | 65.07 |
ratio-regions | 5.73 | 3.80 | 0.19 | 0.13 | 1.38 |
ray | 7.94 | 3.21 | 0.13 | 0.10 | 0.81 |
raytrace | 12.32 | * | * | * | 5.16 |
simple | 10.03 | 11.79 | 0.43 | 0.27 | 3.19 |
smith-normal-form | 8.45 | * | * | 0.13 | 2.39 |
tailfib | 4.59 | 0.92 | 0.04 | 0.02 | 0.18 |
tak | 4.60 | 0.89 | 0.04 | 0.01 | 0.17 |
tensor | 7.34 | * | * | * | 2.06 |
tsp | 5.51 | 2.40 | 0.14 | * | 0.51 |
tyan | 7.38 | 5.87 | 0.27 | 0.20 | 1.97 |
vector-concat | 4.66 | 0.91 | 0.04 | 0.03 | 0.19 |
vector-rev | 4.62 | 0.93 | 0.04 | 0.02 | 0.18 |
vliw | 16.68 | * | * | * | 13.44 |
wc-input1 | 5.86 | 0.96 | 0.05 | 0.02 | 0.21 |
wc-scanStream | 6.10 | 0.96 | 0.05 | 0.03 | 0.21 |
zebra | 7.01 | 2.57 | 0.09 | 0.06 | 0.64 |
zern | 5.21 | * | * | * | 0.50 |
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 | Moscow-ML | Poly/ML | SML/NJ |
barnes-hut | 157,305 | * | * | * | 422,976 |
boyer | 154,559 | 156,737 | 116,300 | 122,880 | 516,136 |
checksum | 70,489 | * | * | * | * |
count-graphs | 81,555 | 88,601 | 84,613 | 98,304 | 450,680 |
DLXSimulator | 185,925 | * | * | * | * |
fft | 79,955 | 85,433 | 84,046 | 65,536 | 424,016 |
fib | 64,227 | 16,101 | 79,892 | 49,152 | 405,248 |
flat-array | 64,271 | 24,413 | 80,034 | 49,152 | 416,528 |
hamlet | 1,301,021 | * | * | * | 1,411,336 |
imp-for | 64,115 | 16,869 | 80,040 | 57,344 | 390,184 |
knuth-bendix | 160,857 | 97,177 | 88,439 | 180,224 | 420,904 |
lexgen | 258,994 | 215,729 | 104,883 | 196,608 | 491,584 |
life | 81,591 | 79,253 | 83,390 | 65,536 | 404,520 |
logic | 125,587 | 115,217 | 87,251 | 114,688 | 430,120 |
mandelbrot | 64,175 | 77,905 | 81,340 | 57,344 | 394,280 |
matrix-multiply | 65,435 | 96,137 | 82,417 | 57,344 | 422,968 |
md5 | 129,249 | * | * | * | * |
merge | 65,835 | 25,601 | 80,090 | 49,152 | 390,192 |
mlyacc | 558,018 | 502,081 | 148,286 | 2,850,816 | 801,904 |
model-elimination | 686,584 | * | * | * | 1,028,344 |
mpuz | 66,895 | 75,925 | 82,382 | 81,920 | 398,376 |
nucleic | 218,271 | 268,237 | * | 221,184 | 477,240 |
output1 | 139,243 | 61,465 | 80,187 | 49,152 | 405,248 |
peek | 133,953 | 60,829 | 81,621 | 57,344 | 409,392 |
psdes-random | 64,851 | 25,529 | * | * | 411,704 |
ratio-regions | 89,779 | 98,489 | 87,482 | 73,728 | 433,208 |
ray | 239,069 | 112,309 | 89,859 | 147,456 | 483,472 |
raytrace | 321,782 | * | * | * | 605,360 |
simple | 276,608 | 202,561 | 94,396 | 475,136 | 746,600 |
smith-normal-form | 239,321 | * | * | 131,072 | 547,984 |
tailfib | 63,899 | 16,301 | 79,943 | 57,344 | 405,248 |
tak | 64,311 | 16,093 | 79,908 | 57,344 | 401,152 |
tensor | 155,108 | * | * | * | 440,432 |
tsp | 133,549 | 99,497 | 86,146 | * | 414,784 |
tyan | 192,229 | 146,101 | 91,586 | 196,608 | 467,032 |
vector-concat | 65,483 | 24,517 | 80,194 | 49,152 | 416,528 |
vector-rev | 64,735 | 24,697 | 80,078 | 57,344 | 416,528 |
vliw | 445,446 | * | * | * | 730,280 |
wc-input1 | 160,129 | 132,765 | 85,771 | 49,152 | 394,280 |
wc-scanStream | 163,633 | 133,261 | 85,947 | 49,152 | 407,296 |
zebra | 176,181 | 44,741 | 83,422 | 90,112 | 409,656 |
zern | 146,473 | * | * | * | 468,120 |