The Computer Language
25.02 Benchmarks Game

Rust versus Intel C

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

If the fastest programs are flagged * possible hand-written vector instructions or "unsafe" or naked ffi, does the host language matter? You might be more interested in the less optimised programs — more seconds, less gz source code.

fannkuch-redux      
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
* Intel C #6 2.25 8.91 3,625 1582 4.46
* Intel C #4 13.39 13.39 2,830 1190 4.38
* Rust #6 3.81 15.06 3,985 1260 11.92
Rust #4 6.94 27.12 3,985 1026 11.71
Rust #5 7.41 28.89 3,990 1023 11.79
Intel C #5 7.77 30.80—30.95 5,378 917 4.46
* Intel C #2 8.70 34.11—34.19 3,457 1563 4.27
Intel C #3 34.59 34.60 2,896 574 4.16
Rust #2 9.19 36.04—36.08 3,723 1198 11.14
Intel C #8 42.87 42.88—43.00 2,892 483 4.15
Intel C 43.45 43.42—43.59 2,896 514 4.22
n-body      
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
* Intel C #9 2.04 2.04 2,966 1639 5.24
* Rust #9 2.19 1.90—3.09 3,023 1881 11.01
* Rust #7 3.24 3.24 2,937 1759 10.53
Rust #3 3.46 3.46 2,937 1774 10.62
* Intel C #4 3.64 3.63—3.69 2,933 1398 5.29
Rust #2 3.65 3.65 3,031 1809 10.49
* Rust #6 4.37 4.36—4.49 3,031 1796 10.86
* Rust #5 5.02 5.03 3,035 2224 10.61
Rust #4 5.13 4.99—5.53 3,039 1810 10.50
Rust 5.52 5.50—5.60 3,027 1483 10.84
Intel C #7 5.55 5.54—5.58 2,961 1250 4.46
* Intel C #5 5.57 5.57 2,937 1436 4.23
Intel C #8 6.01 6.06—6.10 3,039 1195 4.42
Intel C #3 6.18 6.13—6.46 2,970 1214 4.42
Intel C #6 6.20 6.23 2,970 1186 4.50
Intel C 6.24 6.26 2,970 1179 4.46
Intel C #2 6.24 6.23—6.39 2,966 1270 4.30
spectral-norm      
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
* Intel C #6 0.40 1.54—1.58 5,321 1203 5.45
Intel C #8 2.67 2.68 3,215 389 4.71
* Rust #6 0.72 2.85 3,981 1132 12.60
Rust #4 0.72 2.85 4,047 823 12.00
* Rust #5 0.72 2.86 4,018 1062 11.30
* Rust #2 0.72 2.86 4,145 1117 11.00
* Rust 0.72 2.86 4,104 1262 11.75
* Intel C #7 0.73 2.87 5,439 906 5.57
Intel C #3 0.73 2.87—2.92 5,399 470 4.60
* Intel C #4 0.73 2.88 5,382 1145 4.79
* Intel C #5 0.73 2.89 5,464 576 4.76
* Rust #3 0.74 2.94 4,121 1060 10.92
* Rust #7   Empty  
* Intel C #2   Empty  
mandelbrot      
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
* Rust #4 0.95 3.78 35,598 1301 12.26
* Rust #6 1.08 4.21 36,426 1338 12.65
Rust #7 1.10 4.34 35,906 763 12.32
Rust #2 1.10 4.36—4.52 35,754 770 12.80
Rust #5 1.12 4.38 36,311 725 12.27
Rust #3 1.15 4.57 14,615 1013 12.66
Intel C #9 1.83 7.27 36,909 700 4.32
Rust 2.01 7.90 42,631 874 10.94
* Intel C #7 3.14 12.40 37,278 1000 4.62
* Intel C #4 3.22 12.81—12.87 36,958 805 4.24
* Intel C 3.26 12.99 35,803 828 4.36
* Intel C #3 3.32 13.23 35,529 769 4.37
Intel C #8 23.98 23.98 2,839 412 4.38
Intel C #5   Bad Output  
* Intel C #6   Empty  
fasta      
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
Intel C #3 0.84 0.83 2,793 1469 4.71
Intel C #5 1.06 1.06 2,937 1286 4.44
Intel C #2 1.44 1.44 2,773 1299 4.29
* Rust #7 0.78 1.55 4,772 2533 11.68
Rust #3 2.03 2.03 3,199 1235 10.95
Intel C 2.93 2.93 2,945 1213 4.41
Rust #9 0.94 3.20—3.33 5,534 1952 11.24
Intel C #7 0.83 3.28 6,611 2276 4.52
Rust #2 0.95 3.46—3.50 5,554 1910 11.45
Rust #5 0.94 3.48—3.53 5,554 1963 12.19
Rust #4 3.52 3.53 128,217 944 10.63
Rust #6 3.53 3.53 128,381 959 10.62
Rust 4.45 4.54—4.61 3,113 1240 11.09
Intel C #8 7.86 7.90—7.98 2,679 839 4.23
Intel C #4   Empty  
Intel C #6   Timed Out  
k-nucleotide      
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
Rust #7 2.57 8.13—8.39 139,088 1585 13.43
Rust #3 3.28 9.72—10.13 142,631 1549 11.91
Rust #6 2.79 10.06—10.15 165,048 1697 14.10
Rust #5 3.88 11.66—11.92 143,155 1745 12.40
Intel C 6.12 13.40—13.51 134,566 1512 4.77
Rust #2 6.00 15.71—16.24 142,946 1350 11.85
Rust #9 6.33 17.72—18.82 141,099 1850 14.41
Rust #4 6.69 18.00—18.74 142,090 1755 13.13
Rust 21.08 64.42—65.12 161,219 1086 12.16
reverse-complement      
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
* Intel C #7 0.45 0.64 514,732 1899 5.28
Intel C #9 0.48 0.74 514,642 1551 4.34
* Rust 0.55 0.85 512,963 2762 11.72
Rust #2 1.01 1.61 1,022,128 1332 11.04
Intel C #2 1.17 1.70 1,022,149 757 4.32
Rust #3 1.02 1.72 1,022,034 1105 11.45
Intel C #5 2.14 2.14 1,021,334 654 4.55
* Intel C #4 3.76 3.79 514,626 716 4.22
Intel C #6 1.08 4.25—4.29 750,670 828 4.27
binary-trees      [ Contentious. Different approaches. ]
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
Rust #5 1.07 3.84—4.01 139,121 771 1.28
Rust #2 1.17 4.16—4.25 140,157 729 12.50
Rust #4 1.38 4.98—5.02 202,686 765 12.32
Rust #3 1.40 5.15—5.26 172,392 762 11.90
Intel C #2 1.71 5.41 176,718 816 4.92
Intel C #3 2.04 6.23 139,166 842 5.57
Rust 2.10 7.44 137,417 760 11.36
Intel C 17.90 17.93—18.09 271,843 660 4.31
Intel C #5 9.21 33.41—33.58 362,066 914 4.15
pidigits      [ Contentious. Different libraries. ]
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
Rust #4 0.71 0.72 4,055 804 11.82
Intel C #2 0.74 0.74 4,506 422 4.39
Intel C 0.75 0.74 4,448 459 4.39
* Rust #2 0.75 0.75 4,387 1312 10.44
* Rust 0.75 0.75 4,243 1426 10.19
* Rust #3 0.75 0.75 4,510 1373 10.10
regex-redux      [ Contentious. Different libraries. ]
  elapsed Mean or 95% CI      
source secs cpu secs mem gz make
Rust #6 1.21 1.46 159,846 994 13.12
Rust #5 1.35 1.58 209,863 777 12.67
Rust 1.35 1.59—1.63 159,793 811 12.22
Rust #3 1.38 1.63 210,379 726 13.51
Rust #4 1.38 1.64 206,811 771 12.41
Rust #2 1.38 1.64 159,937 707 11.67
* Rust #7 0.78 2.00 157,442 2464 12.48
Intel C #5 0.90 2.89—2.93 160,592 1403 4.64
Intel C #2 3.22 3.22 107,491 1121 4.35
Intel C #4 1.06 4.08—4.13 160,281 1237 4.44
Intel C #3 1.84 4.43 110,412 1273 4.70
Rust

1.84.1
(e71f9a9a9
2025-01-27)
LLVM version: 19.1.5

Intel C

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