The Computer Language
24.09 Benchmarks Game

fasta

First, here are a few naive un-optimised single-thread programs transliterated lowest-common-denominator style into different programming languages from the same original —

Although these un-optimised programs are transliterated from the same original, some language implementations don't buffer stdout by default. Look for moderately optimized programs!

  source secs mem gz    
  Intel C #8 4.13 19,440 825    
  C gcc #8 4.56 19,440 825    
  C clang #8 4.59 19,440 825    
  C# .NET #8 11.10 26,212 883    
  Java #8 15.11 77,032 894    
  Go #8 18.27 19,440 838    
  Swift #8 106.65 19,440 833    
  Python 3 #8 259.98 19,312 730    
  PHP #8 265.71 27,768 742    
  Ruby yjit #8 270.10 27,768 678    
  Node.js #8 8 min 60,800 723    
  Java -Xint #8 11 min 107,836 894    
  Dart #8 14 min 19,440 796    
 
 
  Here are the crowd sourced programs —  
 
 
× source secs mem gz cpu secs cpu load
1.0 C gcc #9 0.78 19,440 1469 0.78 1% 2% 100% 0%
1.0 Chapel #6 0.79 19,436 1108 0.80 100% 0% 1% 1%
1.1 C gcc #2 0.82 19,684 2276 3.25 98% 100% 100% 98%
1.2 Rust #2 0.92 19,932 1910 3.09 84% 83% 83% 87%
1.2 Rust #8 0.93 19,804 1952 3.14 88% 84% 83% 83%
1.2 Rust #5 0.94 19,932 1963 3.14 83% 83% 87% 84%
1.2 C gcc #6 0.94 19,684 1936 2.77 100% 97% 1% 97%
1.3 Chapel #5 1.03 19,436 1391 3.78 100% 89% 89% 90%
1.4 C++ g++ #5 1.07 19,712 2345 3.67 86% 86% 86% 86%
1.4 C++ g++ #6 1.07 19,712 2326 3.85 90% 90% 90% 90%
1.5 F# .NET #3 1.13 72,912 1361 4.17 98% 90% 91% 92%
1.5 Java  #6 1.16 49,848 2549 3.71 78% 91% 78% 73%
1.5 Julia #8 1.17 255,864 1094 1.26 0% 9% 100% 0%
1.6 C# .NET #9 1.21 26,424 1512 1.21 85% 0% 15% 1%
1.6 C gcc #5 1.24 19,684 1286 1.24 99% 1% 0% 0%
1.6 Java #5 1.24 49,640 2478 4.13 80% 87% 85% 83%
1.6 Go #2 1.27 19,808 1405 4.06 81% 83% 80% 78%
1.7 F# .NET #4 1.29 101,008 1355 4.87 97% 95% 93% 94%
1.7 Intel Fortran #4 1.34 19,648 1355 1.34 2% 100% 0% 0%
1.9 C# .NET #5 1.50 62,072 1702 5.46 94% 89% 87% 94%
1.9 Go #3 1.51 19,808 1362 4.09 81% 65% 45% 80%
2.3 C++ g++ #2 1.80 19,712 1129 1.80 100% 0% 0% 1%
2.4 C# .NET 1.84 52,300 2113 6.73 91% 93% 94% 89%
2.4 C++ g++ 1.90 19,712 1064 1.90 100% 0% 0% 1%
2.5 Rust #3 1.98 19,804 1235 1.97 0% 99% 0% 0%
3.3 Ada 2012 GNAT #5 2.60 19,568 2220 2.59 0% 1% 0% 100%
3.4 C++ g++ #3 2.62 19,712 1311 2.62 85% 0% 1% 14%
3.4 Ada 2012 GNAT #2 2.63 19,568 2158 2.63 100% 0% 0% 0%
3.6 C gcc #7 2.79 19,440 1299 2.79 1% 0% 100% 0%
3.7 Julia #5 2.86 269,312 957 3.24 14% 5% 94% 1%
3.7 Julia #4 2.89 258,680 1053 3.25 95% 0% 17% 1%
3.9 C gcc #4 3.03 19,684 1244 3.03 100% 0% 0% 0%
3.9 Dart #5 3.07 403,140 1489 4.89 1% 57% 97% 4%
4.2 Java #4 3.28 44,352 1528 3.40 99% 1% 0% 3%
4.3 C++ g++ #4 3.34 19,712 1291 3.34 0% 0% 100% 0%
4.3 OCaml #6 3.36 201,984 1194 3.36 0% 0% 100% 0%
4.4 Rust #6 3.46 123,652 959 3.45 0% 100% 0% 0%
4.6 Rust #4 3.57 123,652 944 3.57 0% 99% 0% 0%
4.8 Go 3.73 19,808 1055 3.74 0% 0% 0% 100%
4.8 C gcc 3.74 19,684 1213 3.74 100% 0% 0% 1%
5.2 Chapel #3 4.02 19,436 1219 4.03 100% 1% 0% 1%
5.4 Dart #3 4.17 490,028 1114 4.19 45% 55% 1% 1%
5.4 Dart #4 4.18 402,928 1307 4.29 3% 98% 0% 1%
5.5 Rust 4.24 19,804 1240 4.24 0% 100% 0% 1%
5.7 Dart 4.44 19,808 1407 4.44 0% 99% 0% 0%
5.7 Java #2 4.45 48,896 1259 4.60 3% 0% 0% 99%
5.8 Lisp SBCL #6 4.48 19,680 1763 4.48 0% 0% 0% 100%
5.9 C gcc #8 4.56 19,440 825 4.55 0% 0% 100% 0%
6.1 OCaml #3 4.71 19,676 1075 4.71 100% 0% 0% 0%
6.7 Lisp SBCL #3 5.24 22,912 1592 5.24 0% 0% 0% 100%
7.0 Haskell GHC 5.45 19,804 975 5.54 47% 16% 2% 36%
7.2 Free Pascal #6 5.60 19,636 1196 5.60 100% 0% 0% 1%
7.3 Free Pascal #5 5.65 19,636 1225 5.65 0% 0% 100% 0%
7.5 Intel Fortran 5.83 19,648 1193 5.83 0% 100% 0% 0%
8.0 Intel Fortran #3 6.19 19,648 1217 6.19 0% 100% 0% 0%
8.5 Haskell GHC #2 6.60 440,192 1323 18.63 85% 74% 66% 63%
8.6 Haskell GHC #3 6.68 619,208 1091 6.79 0% 9% 1% 90%
9.0 Ada 2012 GNAT 7.01 19,568 1381 7.00 0% 0% 0% 100%
11 Lisp SBCL #2 8.85 23,296 1628 8.84 0% 100% 0% 0%
12 Lisp SBCL 9.02 26,112 1430 9.02 0% 99% 0% 0%
14 C# .NET #8 11.10 26,212 883 11.12 0% 0% 0% 99%
15 Julia #3 11.66 256,384 901 12.01 0% 2% 0% 100%
18 Dart #2 13.69 19,808 1075 13.69 0% 0% 0% 100%
19 Java #8 15.11 77,032 894 15.49 1% 1% 7% 93%
23 Go #8 18.27 19,440 838 18.46 25% 23% 25% 28%
24 Racket 18.49 75,628 1071 18.48 83% 17% 0% 0%
25 Erlang #2 19.29 55,904 1170 21.10 3% 99% 1% 4%
27 PHP #3 21.15 19,804 1065 21.14 40% 60% 0% 0%
31 Lua #3 24.08 19,652 1065 24.08 0% 100% 0% 0%
31 Lua #2 24.15 19,652 1065 24.14 0% 0% 0% 100%
36 Python 3 #5 27.86 827,284 1951 53.94 73% 48% 45% 27%
38 PHP #2 29.41 19,804 1054 29.41 0% 0% 100% 0%
39 VW Smalltalk 30.08 55,168 1542 30.07 0% 0% 100% 0%
41 Ruby yjit #6 31.90 120,832 1097 31.90 83% 0% 17% 0%
49 Node.js 38.06 57,560 815 38.45 0% 99% 0% 0%
50 Python 3 #2 39.00 19,312 1126 39.00 95% 0% 0% 4%
50 Python 3 #3 39.12 19,312 1007 39.12 92% 0% 0% 8%
56 Ruby yjit #3 43.90 120,576 1035 43.90 100% 0% 0% 0%
74 Python 3 57.21 19,312 823 57.20 0% 100% 0% 0%
77 Perl 60.07 55,296 875 60.07 100% 0% 0% 0%
108 Erlang 84.14 55,008 1045 170.84 76% 69% 32% 25%
117 Ruby yjit #5 90.76 23,168 1000 90.75 94% 0% 5% 0%
122 Ruby yjit #4 95.10 266,624 864 95.09 0% 100% 0% 0%
136 Ruby yjit #2 106.06 147,176 747 106.05 98% 0% 1% 0%
137 Swift #8 106.65 19,440 833 106.65 0% 0% 0% 100%
163 Perl #4 126.60 19,684 969 125.89 0% 0% 0% 99%
244 Perl #2 189.89 19,684 926 189.24 0% 99% 0% 0%
334 Python 3 #8 259.98 19,312 730 259.80 0% 99% 0% 0%
342 PHP #8 265.71 27,768 742 265.18 89% 3% 7% 0%
347 Ruby yjit #8 270.10 27,768 678 269.94 99% 0% 0% 0%
416 Matz's Ruby #4 5 min 275,584 864 5 min 97% 2% 0% 0%
469 Matz's Ruby #5 6 min 19,688 1000 6 min 99% 0% 0% 0%
552 Matz's Ruby #2 7 min 248,360 747 7 min 100% 0% 0% 0%
685 Node.js #8 8 min 60,800 723 8 min 82% 16% 0% 1%
  Dart #8 14 min 19,440 796 14 min 0% 100% 0% 0%
C++ g++ #7 Make Error
Matz's Ruby #3 Failed
Matz's Ruby #6 Failed
Matz's Ruby #8 Bad Output
 
 
  hand-written vector instructions | "unsafe"
 
× source secs mem gz cpu secs cpu load
1.0 Rust #7 0.77 19,804 2533 1.54 64% 1% 100% 37%
1.0 C++ g++ #8 0.78 19,712 2758 1.54 2% 100% 64% 37%
1.1 Haskell GHC #6 0.86 19,936 1885 2.82 82% 82% 83% 83%
1.1 Haskell GHC #4 0.86 42,752 2017 2.87 83% 83% 83% 83%
1.2 Haskell GHC #5 0.93 19,808 2004 2.93 81% 78% 78% 78%
2.7 Swift #2 2.11 19,440 1952 3.76 22% 80% 74% 4%
2.8 Julia #7 2.15 354,232 1189 5.41 71% 50% 53% 80%
2.8 Swift #3 2.18 31,248 2097 5.40 74% 62% 74% 38%
3.1 Julia #6 2.38 352,944 1213 5.19 42% 54% 54% 70%
3.2 Node.js #5 2.49 106,400 2050 6.99 79% 75% 58% 72%
6.6 Swift 5.15 19,440 1533 5.14 0% 0% 0% 100%
10 Racket #3 8.10 76,680 1291 8.09 0% 100% 0% 0%