This page compares the performance of a number of SML compilers on a range of benchmarks. For a performance comparison of many different languages, including MLton, see the Computer Language Shootout.
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. A * in an entry means the compiler failed to compile the benchmark or that the benchmark failed to run.
benchmark | MLton | ML-Kit | MosML | Poly/ML | SML/NJ |
---|---|---|---|---|---|
1.0 |
* |
* |
* |
1.6 |
|
1.0 |
* |
10.1 |
1.9 |
3.1 |
|
1.0 |
* |
* |
* |
* |
|
1.0 |
7.3 |
60.7 |
4.2 |
3.8 |
|
1.0 |
* |
* |
* |
* |
|
1.0 |
1.2 |
* |
24.2 |
0.8 |
|
1.0 |
0.9 |
5.0 |
1.2 |
1.3 |
|
1.0 |
2.2 |
35.0 |
1041.6 |
13.4 |
|
1.0 |
* |
* |
* |
3.1 |
|
1.0 |
2.8 |
63.0 |
5.1 |
5.6 |
|
1.0 |
* |
19.8 |
4.8 |
4.6 |
|
1.0 |
2.5 |
5.0 |
1.7 |
1.5 |
|
1.0 |
1.7 |
30.6 |
7.7 |
1.4 |
|
1.0 |
* |
9.4 |
1.2 |
2.1 |
|
1.0 |
4.2 |
34.0 |
51.1 |
1.3 |
|
1.0 |
8.3 |
42.5 |
13.2 |
5.3 |
|
1.0 |
* |
* |
* |
* |
|
1.0 |
* |
* |
1.1 |
7.9 |
|
1.0 |
1.5 |
8.2 |
1.2 |
2.2 |
|
1.0 |
* |
* |
* |
2.6 |
|
1.0 |
2.3 |
78.2 |
4.6 |
4.1 |
|
1.0 |
* |
* |
23.5 |
0.8 |
|
1.0 |
30.7 |
61.4 |
16.2 |
14.4 |
|
1.0 |
15.2 |
176.9 |
17.9 |
11.3 |
|
1.0 |
5.0 |
* |
* |
2.7 |
|
1.0 |
2.0 |
34.7 |
2.1 |
5.4 |
|
1.0 |
* |
14.8 |
22.3 |
0.8 |
|
1.0 |
* |
* |
* |
3.3 |
|
1.0 |
1.7 |
19.3 |
7.3 |
2.4 |
|
1.0 |
* |
* |
* |
||
1.0 |
1.0 |
51.9 |
3.2 |
1.4 |
|
1.0 |
1.2 |
17.0 |
1.3 |
2.0 |
|
1.0 |
* |
* |
* |
7.4 |
|
1.0 |
3.4 |
31.8 |
* |
17.7 |
|
1.0 |
* |
15.7 |
1.0 |
1.6 |
|
1.0 |
1.2 |
20.4 |
2.0 |
20.4 |
|
1.0 |
2.2 |
41.9 |
2.3 |
152.4 |
|
1.0 |
* |
* |
* |
2.5 |
|
1.0 |
11.1 |
* |
7.5 |
17.2 |
|
1.0 |
22.1 |
* |
203.7 |
11.5 |
|
1.0 |
3.9 |
30.2 |
3.4 |
8.5 |
|
1.0 |
* |
* |
* |
2.6 |
Note: for SML/NJ, the smith-normal-form.sml 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 |
---|---|---|---|---|---|
103,231 |
* |
* |
* |
433,216 |
|
138,518 |
163,204 |
116,300 |
122,880 |
526,376 |
|
52,794 |
* |
* |
* |
* |
|
66,838 |
84,124 |
84,613 |
98,304 |
454,776 |
|
129,398 |
* |
* |
* |
* |
|
64,797 |
80,240 |
84,046 |
65,536 |
434,256 |
|
47,738 |
18,588 |
79,892 |
49,152 |
415,488 |
|
47,762 |
23,820 |
80,034 |
49,152 |
410,680 |
|
1,256,813 |
* |
* |
* |
1,412,360 |
|
47,626 |
19,372 |
80,040 |
57,344 |
400,424 |
|
109,126 |
93,400 |
88,439 |
180,224 |
431,144 |
|
203,559 |
208,332 |
104,883 |
196,608 |
501,824 |
|
66,130 |
78,084 |
83,390 |
65,536 |
414,760 |
|
106,614 |
116,880 |
87,251 |
114,688 |
440,360 |
|
47,690 |
77,004 |
81,340 |
57,344 |
404,520 |
|
49,181 |
87,016 |
82,417 |
57,344 |
435,256 |
|
77,646 |
* |
* |
* |
* |
|
49,318 |
24,296 |
80,090 |
49,152 |
400,432 |
|
507,431 |
473,748 |
148,286 |
2,850,816 |
820,336 |
|
638,084 |
* |
* |
* |
1,009,880 |
|
50,594 |
73,232 |
82,382 |
81,920 |
408,616 |
|
199,181 |
258,552 |
* |
221,184 |
487,480 |
|
80,720 |
63,336 |
80,187 |
49,152 |
399,400 |
|
76,302 |
62,092 |
81,621 |
57,344 |
403,544 |
|
48,402 |
25,196 |
* |
* |
421,944 |
|
73,914 |
95,924 |
87,482 |
73,728 |
443,448 |
|
183,243 |
108,848 |
89,859 |
147,456 |
493,712 |
|
265,332 |
* |
* |
* |
636,112 |
|
222,914 |
192,032 |
94,396 |
475,136 |
756,840 |
|
181,686 |
* |
* |
131,072 |
558,224 |
|
47,434 |
18,804 |
79,943 |
57,344 |
399,400 |
|
47,818 |
18,580 |
79,908 |
57,344 |
411,392 |
|
97,677 |
* |
* |
* |
450,672 |
|
82,190 |
97,716 |
86,146 |
* |
425,024 |
|
134,910 |
137,800 |
91,586 |
196,608 |
477,272 |
|
49,018 |
23,924 |
80,194 |
49,152 |
410,680 |
|
48,246 |
24,104 |
80,078 |
57,344 |
410,680 |
|
393,762 |
* |
* |
* |
731,304 |
|
101,850 |
129,212 |
85,771 |
49,152 |
404,520 |
|
109,106 |
129,708 |
85,947 |
49,152 |
405,544 |
|
141,146 |
41,532 |
83,422 |
90,112 |
419,896 |
|
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 |
---|---|---|---|---|---|
8.28 |
* |
* |
* |
1.37 |
|
8.14 |
8.99 |
0.39 |
0.12 |
3.20 |
|
5.45 |
* |
* |
* |
* |
|
6.12 |
2.06 |
0.14 |
0.05 |
0.90 |
|
9.81 |
* |
* |
* |
* |
|
5.95 |
1.32 |
0.11 |
0.05 |
0.69 |
|
5.45 |
0.60 |
0.05 |
0.02 |
0.22 |
|
5.33 |
0.61 |
0.04 |
0.01 |
0.25 |
|
85.70 |
* |
* |
* |
88.87 |
|
5.37 |
0.73 |
0.05 |
0.01 |
0.25 |
|
7.09 |
4.11 |
0.19 |
0.12 |
1.60 |
|
11.02 |
7.21 |
0.40 |
0.26 |
3.63 |
|
5.84 |
2.16 |
0.10 |
0.04 |
0.64 |
|
7.02 |
4.82 |
0.22 |
0.09 |
1.68 |
|
5.41 |
0.75 |
0.06 |
0.02 |
0.29 |
|
5.39 |
0.77 |
0.06 |
0.01 |
0.30 |
|
6.01 |
* |
* |
* |
* |
|
5.41 |
0.62 |
0.06 |
0.02 |
0.26 |
|
24.70 |
40.69 |
3.35 |
1.08 |
18.04 |
|
25.04 |
* |
* |
* |
28.79 |
|
5.41 |
1.07 |
0.07 |
0.03 |
0.45 |
|
14.24 |
24.79 |
* |
0.36 |
2.78 |
|
6.05 |
0.68 |
0.05 |
0.01 |
0.23 |
|
6.04 |
0.70 |
0.05 |
0.02 |
0.25 |
|
5.39 |
0.75 |
* |
* |
64.13 |
|
6.63 |
4.02 |
0.21 |
0.11 |
1.50 |
|
9.51 |
3.02 |
0.15 |
0.08 |
1.03 |
|
13.92 |
* |
* |
* |
5.08 |
|
11.40 |
13.19 |
0.43 |
0.21 |
3.76 |
|
8.90 |
* |
* |
0.10 |
2.25 |
|
5.35 |
0.64 |
0.05 |
0.02 |
0.24 |
|
5.36 |
0.62 |
0.05 |
0.01 |
0.22 |
|
8.75 |
* |
* |
* |
2.81 |
|
6.50 |
1.93 |
0.15 |
* |
0.66 |
|
8.86 |
6.25 |
0.30 |
0.17 |
2.28 |
|
5.52 |
0.68 |
0.05 |
0.01 |
0.25 |
|
5.33 |
0.64 |
0.05 |
0.02 |
0.26 |
|
18.28 |
* |
* |
* |
13.12 |
|
6.85 |
0.68 |
0.07 |
0.02 |
0.27 |
|
7.07 |
0.69 |
0.06 |
0.02 |
0.29 |
|
8.57 |
2.30 |
0.09 |
0.04 |
0.78 |
|
6.20 |
* |
* |
* |
0.65 |