The Computer Language
24.06 Benchmarks Game

Rust versus Intel C fastest performance

How the programs are written matters! Always look at the source code.

If the fastest programs are hand-written vector instructions, does the host language matter? You might be more interested in the less optimised programs — more seconds, less gz source code.

fannkuch-redux
source secs mem gz cpu secs
Intel C #6 2.24 19,684 1582 8.89
Intel C #4 13.38 19,684 1190 13.38
Rust #6 3.92 19,072 1260 15.36
Rust #4 6.96 19,072 1026 27.18
Rust #5 7.72 19,072 1023 30.41
Intel C #5 7.75 19,684 917 30.71
Intel C #2 8.72 19,940 1563 34.15
Intel C #3 34.58 19,684 574 34.58
Rust #2 9.42 19,072 1198 36.90
Intel C 43.31 19,684 514 43.31
n-body
source secs mem gz cpu secs
Intel C #9 2.03 19,684 1639 2.03
Rust #9 2.17 19,072 1881 2.17
Rust #7 3.24 19,072 1759 3.24
Intel C #8 3.62 19,684 1398 3.62
Rust #2 3.94 19,072 1809 3.94
Rust #6 4.31 19,072 1796 4.30
Rust #8 4.49 19,072 1774 4.49
Intel C #4 4.92 19,684 1496 4.92
Rust #5 5.01 19,072 2224 5.01
Rust #4 5.17 19,072 1810 5.17
Rust 5.51 19,072 1483 5.51
Intel C #7 5.54 19,684 1250 5.54
Rust #3 5.55 19,072 1546 5.55
Intel C #5 5.56 19,684 1436 5.56
Intel C #3 6.17 19,684 1214 6.17
Intel C 6.21 19,684 1179 6.21
Intel C #6 6.22 19,684 1186 6.22
Intel C #2 6.24 19,684 1270 6.24
spectral-norm
source secs mem gz cpu secs
Intel C #6 0.39 20,724 1203 1.54
Intel C 2.67 20,788 390 2.67
Rust #4 0.72 19,076 823 2.85
Rust #6 0.72 19,076 1132 2.85
Rust #5 0.72 19,076 1062 2.85
Rust #7 0.72 19,076 938 2.85
Intel C #5 0.72 19,700 576 2.87
Intel C #7 0.73 19,700 906 2.88
Intel C #4 0.73 21,012 1145 2.89
Intel C #3 0.73 19,700 470 2.89
Rust #2 0.78 19,076 1117 3.03
Rust 0.79 19,076 1262 3.04
Rust #3 0.92 19,076 1060 3.57
Intel C #8   Make Error  
mandelbrot
source secs mem gz cpu secs
Rust #4 0.94 33,280 1301 3.73
Rust #6 1.08 34,048 1338 4.22
Rust #7 1.06 33,280 763 4.22
Rust #8 1.06 33,280 770 4.22
Rust #5 1.13 33,792 725 4.45
Rust #3 1.14 19,072 1013 4.54
Intel C #9 1.82 34,688 700 7.25
Rust 2.03 39,168 874 7.89
Intel C #7 3.12 34,560 1000 12.39
Intel C #4 3.21 34,560 805 12.78
Intel C 3.25 33,024 828 12.97
Intel C #3 3.31 33,024 769 13.21
Intel C #2 23.96 19,684 412 23.96
Intel C #6   Make Error  
Intel C #8   Bad Output  
pidigits
source secs mem gz cpu secs
Rust #4 0.71 19,076 804 0.71
Rust #3 0.74 19,076 1373 0.74
Rust 0.74 19,076 1426 0.74
Rust #2 0.75 19,076 1312 0.75
Intel C #2 0.82 19,812 422 0.82
Intel C 0.88 19,844 459 0.88
regex-redux
source secs mem gz cpu secs
Rust #6 1.19 153,456 994 1.45
Rust #5 1.31 202,588 777 1.56
Rust 1.34 153,776 811 1.58
Rust #4 1.34 199,540 771 1.60
Rust #2 1.35 153,780 707 1.60
Rust #3 1.36 202,904 726 1.62
Rust #7 0.78 151,040 2464 1.99
Intel C #5 0.89 154,780 1403 2.89
Intel C #2 3.20 103,680 1121 3.20
Intel C #4 1.04 154,628 1237 4.02
Intel C #3 1.83 106,240 1273 4.40
fasta
source secs mem gz cpu secs
Intel C #9 0.83 19,684 1469 0.83
Intel C #5 1.06 19,684 1286 1.05
Intel C #8 1.43 19,684 1299 1.43
Rust #7 0.77 19,072 2533 1.54
Rust #3 1.99 19,072 1235 1.99
Intel C 2.92 19,684 1213 2.92
Intel C #6 1.03 19,684 1936 3.02
Rust #8 0.92 19,072 1952 3.11
Intel C #2 0.82 19,684 2276 3.26
Intel C #7 0.85 19,684 2018 3.29
Rust #5 0.93 19,072 1963 3.37
Rust #2 0.94 19,072 1910 3.37
Rust #6 3.47 123,656 959 3.46
Rust #4 3.58 123,656 944 3.58
Intel C #3 4.12 19,684 825 4.12
Rust 4.21 19,072 1240 4.21
Intel C #4   Make Error  
k-nucleotide
source secs mem gz cpu secs
Rust #7 2.84 133,808 1585 8.92
Rust #8 3.55 137,360 1549 10.66
Rust #6 3.00 159,596 1697 10.88
Rust #5 3.96 137,896 1745 11.92
Intel C 6.17 129,600 1512 13.43
Rust #2 6.37 137,736 1350 16.21
Rust #9 6.36 135,720 1850 17.37
Rust #4 6.64 137,260 1755 17.99
Rust 22.12 157,252 1086 66.01
reverse-complement
source secs mem gz cpu secs
Intel C #7 0.44 500,272 1899 0.60
Intel C #8 0.47 500,184 1551 0.72
Rust 0.53 498,816 2762 0.83
Rust #2 0.96 995,072 1332 1.59
Intel C #2 1.16 994,816 757 1.68
Rust #3 0.98 995,200 1105 1.70
Intel C #5 2.13 994,560 654 2.13
Intel C #4 3.79 500,864 716 3.78
Intel C #6 1.06 752,984 828 4.16
binary-trees
source secs mem gz cpu secs
Rust #5 1.05 198,528 771 3.67
Rust #2 1.20 199,556 729 4.26
Rust #4 1.35 198,900 765 4.88
Rust #3 1.43 193,728 762 5.15
Intel C #2 1.66 170,496 816 5.36
Intel C #3 2.00 134,528 842 6.12
Rust 2.07 132,736 760 7.36
Intel C 17.93 264,064 660 17.93
Intel C #5 9.37 351,488 914 34.02
Rust

1.79.0
(129f3b996
2024-06-10)
LLVM version: 18.1.7

Intel C

Intel(R) oneAPI DPC++/C++ Compiler
2024.1.0.20240308