The Computer Language
24.11 Benchmarks Game

C clang versus Julia 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
* C clang #6 2.24 19,772 1582 8.86
* C clang #4 13.37 19,772 1190 13.37
* Julia #2 8.49 251,248 1077 31.91
C clang #5 8.09 19,772 917 31.94
* C clang #2 8.67 19,772 1563 34.02
C clang #3 34.16 19,772 574 34.15
* Julia #3 9.33 248,484 896 35.56
C clang #8 36.39 19,492 483 36.38
C clang 36.51 19,772 514 36.50
Julia 42.59 226,292 441 42.67
n-body
source secs mem gz cpu secs
* C clang #9 2.20 19,772 1639 2.20
Julia #5 3.67 261,584 1129 3.77
* C clang #5 4.86 19,772 1436 4.86
C clang #6 5.16 19,772 1186 5.16
C clang 5.37 19,772 1179 5.37
C clang #2 5.42 19,772 1270 5.42
* C clang #4 5.60 19,772 1398 5.59
C clang #8 5.72 19,492 1193 5.72
C clang #3 6.12 19,772 1214 6.12
Julia #4 6.48 263,596 1168 6.57
C clang #7 6.77 19,772 1250 6.77
Julia #3 6.92 264,476 1548 7.01
Julia #2 28.72 278,196 1084 28.92
spectral-norm
source secs mem gz cpu secs
* C clang #6 0.38 19,772 1203 1.52
* C clang #4 0.72 19,772 1145 2.86
* C clang #2 0.72 19,772 941 2.87
* C clang #5 0.72 19,772 576 2.88
Julia #4 1.18 232,768 435 3.66
Julia #2 1.76 261,124 377 4.80
C clang #8 5.40 19,772 389 5.40
C clang #3 1.46 19,772 470 5.77
* C clang #7 1.82 19,772 906 7.24
mandelbrot
source secs mem gz cpu secs
Julia #7 1.41 273,748 629 4.79
C clang #9 1.22 34,332 700 4.85
Julia #2 1.44 272,612 634 4.88
Julia #3 1.50 291,868 589 5.11
Julia #4 1.96 283,940 583 5.12
Julia #5 1.63 296,828 580 5.76
Julia #6 2.12 289,896 571 5.80
C clang #5 1.53 34,864 788 6.09
* C clang #4 3.47 34,328 805 13.82
* C clang 3.49 33,172 828 13.93
* C clang #7 3.53 34,216 1000 14.00
* C clang #3 3.55 33,108 769 14.15
C clang #8 25.27 19,496 412 25.27
Julia 26.55 254,964 379 26.63
* C clang #6   Make Error  
fasta
source secs mem gz cpu secs
C clang #9 0.78 19,772 1469 0.78
C clang #5 1.19 19,772 1286 1.19
Julia #2 1.17 234,156 1094 1.25
C clang #7 2.43 19,772 1299 2.43
Julia #5 2.57 250,416 957 2.66
Julia #4 2.62 236,892 1053 2.72
C clang #6 1.03 19,772 1936 3.03
C clang #2 0.83 19,772 2276 3.28
C clang 3.46 19,772 1213 3.46
C clang #8 4.60 19,772 825 4.60
* Julia #6 2.12 353,084 1213 4.86
* Julia #7 1.87 348,656 1189 5.33
Julia #3 11.61 234,416 901 11.70
C clang #4   Make Error  
k-nucleotide
source secs mem gz cpu secs
C clang 6.30 129,228 1512 13.92
Julia #6 6.03 429,688 965 14.32
Julia #7 8.87 479,756 1379 22.94
Julia 132.60 1,558,404 703 132.21
reverse-complement
source secs mem gz cpu secs
* C clang #7 0.45 499,996 1899 0.63
C clang #9 0.46 499,976 1551 0.70
C clang #2 1.16 994,536 757 1.69
Julia #7 1.65 1,024,148 531 1.76
C clang #5 2.08 994,108 654 2.07
Julia #9 2.00 1,220,680 456 2.11
* C clang #4 3.74 500,452 716 3.74
C clang #6 1.03 703,416 828 4.07
Julia #2 29.29 1,951,468 464 29.83
binary-trees
source secs mem gz cpu secs
C clang #2 1.66 170,236 816 5.36
C clang #3 1.89 134,272 842 5.88
Julia #4 10.32 443,600 378 11.22
Julia #2 11.38 441,140 430 12.44
C clang 17.79 264,064 660 17.79
Julia #3 7.08 486,976 640 19.44
C clang #8 19.63 285,536 607 19.62
C clang #5 9.25 351,328 914 33.65
Julia #5 17.97 482,024 396 57.53
pidigits
source secs mem gz cpu secs
C clang #2 0.74 19,772 422 0.74
C clang 0.74 19,772 459 0.74
* Julia #3 1.04 223,936 512 1.18
* Julia #2 1.14 232,460 686 1.26
regex-redux
source secs mem gz cpu secs
C clang #5 0.82 154,568 1403 2.82
* Julia #5 1.80 431,004 766 3.12
C clang #2 3.22 103,364 1121 3.22
* Julia #4 1.89 433,140 772 3.22
* Julia #3 2.07 578,576 630 3.51
C clang #4 0.98 154,488 1237 3.82
Julia 4.10 606,148 414 4.24
C clang #3 1.75 105,848 1273 4.31
C clang

Ubuntu clang version 18.1.8 (11)

Julia

julia version 1.11.1