The Computer Language
22.01 Benchmarks Game

n-body

Always look at the source code.

Look at the slower simple sequential programs, and  look at the parallel programs written for multicore, and  look at the manually vectorized SIMD programs. Choose which programs you want to compare.

× source secs mem gz busy cpu load
1.0 C gcc #9 2.13 992 1633 2.22 1% 1% 2% 100%
1.0 C++ g++ 2.17 992 1927 2.23 1% 0% 100% 1%
1.4 Rust #9 2.90 1,052 1874 2.98 0% 1% 100% 1%
1.5 C# .NET #9 3.18 32,632 2467 3.23 2% 99% 0% 1%
1.5 Rust #7 3.20 1,052 1753 3.26 0% 100% 1% 1%
1.8 C# .NET #4 3.83 32,376 2125 3.92 99% 0% 2% 1%
1.9 C++ g++ #2 4.06 1,992 1879 4.08 0% 100% 0% 0%
1.9 C gcc #8 4.10 8 1391 4.18 0% 100% 0% 2%
2.0 Classic Fortran #6 4.21 1,340 1524 4.25 0% 0% 100% 0%
2.0 Julia #8 4.21 226,420 1111 4.49 100% 3% 2% 2%
2.0 C++ g++ #7 4.26 1,996 1808 4.31 0% 100% 0% 0%
2.1 C gcc #4 4.44 1,300 1490 4.56 1% 0% 100% 1%
2.1 Rust #6 4.48 1,100 1790 4.59 2% 0% 100% 0%
2.3 C# .NET #7 4.79 32,924 1704 4.87 100% 1% 0% 0%
2.3 C# .NET #6 4.81 32,992 1742 4.82 0% 0% 100% 0%
2.4 F# .NET #6 5.00 36,308 1383 4.99 0% 99% 0% 0%
2.4 Ada 2012 GNAT #2 5.11 2,196 2617 5.26 1% 0% 100% 2%
2.5 Swift #7 5.27 10,888 1326 5.29 100% 0% 0% 0%
2.5 Swift #4 5.28 10,916 1355 5.41 0% 1% 100% 1%
2.5 Swift #5 5.29 13,924 1365 5.33 0% 0% 0% 100%
2.5 Classic Fortran #2 5.37 612 1500 5.39 100% 0% 0% 0%
2.6 Classic Fortran 5.48 612 1393 5.51 0% 0% 100% 0%
2.6 Rust #3 5.53 1,048 1540 5.67 1% 100% 1% 1%
2.6 Rust #2 5.59 1,096 1805 5.71 0% 2% 100% 1%
2.7 Julia #4 5.67 203,804 1155 5.94 2% 100% 2% 2%
2.7 Rust 5.67 1,048 1480 5.79 0% 100% 2% 0%
2.7 C++ g++ #4 5.68 1,040 1428 5.73 100% 1% 0% 0%
2.7 C++ g++ #6 5.69 1,300 1668 5.71 0% 0% 100% 0%
2.7 Swift #8 5.70 13,868 1681 5.72 0% 0% 100% 0%
2.7 C++ g++ #3 5.73 1,284 1396 5.76 0% 0% 0% 100%
2.7 C++ g++ #9 5.76 1,300 2056 5.77 100% 0% 0% 0%
2.7 Rust #8 5.85 1,096 1767 5.96 2% 100% 0% 0%
2.8 C++ g++ 5.92 1,240 1659 5.92 100% 0% 0% 0%
2.8 Classic Fortran #5 5.97 1,340 1664 6.19 0% 3% 100% 1%
2.8 Rust #5 5.97 1,044 2220 6.08 1% 100% 0% 1%
2.9 C++ g++ #8 6.09 1,240 1517 6.10 0% 0% 0% 100%
2.9 C gcc #5 6.10 1,044 1429 6.19 1% 100% 1% 0%
2.9 C++ g++ #5 6.13 2,028 1749 6.17 0% 0% 0% 100%
2.9 Swift #6 6.15 6,388 1194 6.19 100% 0% 0% 0%
2.9 F# .NET #5 6.17 36,312 1351 6.18 0% 0% 0% 100%
2.9 Classic Fortran #4 6.17 1,340 1179 6.20 0% 0% 0% 100%
2.9 Rust #4 6.23 1,052 1803 6.58 1% 3% 2% 100%
2.9 Chapel #2 6.23 5,232 971 6.31 100% 0% 1% 0%
3.0 Free Pascal 6.28 8 1308 6.30 0% 0% 0% 100%
3.0 Free Pascal #2 6.28 8 1322 6.31 0% 0% 0% 100%
3.0 Classic Fortran #3 6.31 1,340 1305 6.34 0% 0% 100% 0%
3.0 Go #3 6.37 1,160 1200 6.42 0% 0% 0% 100%
3.1 Haskell GHC #2 6.50 6,220 1883 6.69 2% 100% 1% 0%
3.1 Ada 2012 GNAT #3 6.51 2,200 1750 6.52 0% 0% 0% 100%
3.1 Go 6.57 1,108 1310 6.60 0% 100% 0% 0%
3.2 Julia #3 6.77 209,012 1541 7.07 1% 1% 100% 2%
3.2 Java  #4 6.77 35,672 1489 7.02 3% 99% 1% 1%
3.2 C gcc #7 6.79 1,236 1244 6.90 0% 1% 0% 100%
3.2 OCaml 6.83 1,704 1251 7.00 1% 100% 0% 1%
3.2 F# .NET #3 6.85 34,272 1617 6.89 1% 0% 100% 0%
3.2 C# .NET #3 6.91 32,556 1305 6.91 0% 0% 100% 0%
3.3 Go #2 6.93 1,604 1215 6.99 0% 0% 100% 0%
3.3 F# .NET #4 7.00 32,812 1290 7.03 0% 0% 100% 0%
3.3 Java #5 7.03 36,116 1429 7.05 0% 100% 0% 0%
3.3 C# .NET #2 7.04 32,872 1343 7.06 0% 0% 100% 0%
3.3 C# .NET #8 7.06 32,712 1332 7.24 1% 1% 100% 1%
3.4 Free Pascal #3 7.16 8 1418 7.21 100% 0% 0% 0%
3.4 Haskell GHC 7.18 5,436 1706 7.76 3% 100% 2% 3%
3.4 C gcc #2 7.19 1,296 1263 8.13 2% 100% 4% 7%
3.4 C gcc #6 7.22 1,300 1180 7.61 3% 100% 1% 2%
3.4 C gcc #3 7.23 1,296 1208 7.36 1% 100% 0% 1%
3.4 F# .NET #2 7.25 36,580 1381 7.23 99% 0% 0% 0%
3.4 Ada 2012 GNAT 7.28 2,196 1618 7.33 49% 52% 0% 0%
3.5 Java #3 7.44 36,100 1430 7.50 0% 0% 100% 1%
3.5 Java #2 7.46 36,176 1424 7.48 0% 0% 0% 100%
3.5 C gcc 7.55 1,300 1173 7.66 0% 1% 0% 100%
3.6 Lisp SBCL #2 7.70 18,828 1403 7.77 0% 100% 0% 1%
3.6 Dart #6 7.71 10,168 1311 7.77 100% 0% 0% 1%
3.7 Java 7.81 38,484 1430 7.84 0% 100% 0% 0%
4.0 Node js #6 8.42 39,284 1268 9.11 3% 100% 3% 2%
4.1 Ada 2012 GNAT #5 8.72 2,180 2447 8.75 0% 0% 100% 0%
4.5 Swift #2 9.59 6,364 1192 9.63 100% 0% 0% 0%
4.8 Dart #2 10.22 10,540 1266 10.28 0% 0% 0% 100%
5.9 Dart #3 12.55 10,444 1407 12.58 100% 0% 0% 0%
6.2 Lisp SBCL 13.18 18,816 1368 13.20 100% 0% 0% 0%
6.6 Racket #2 14.06 69,828 1689 14.11 0% 100% 0% 0%
11 Julia #2 24.18 269,444 1078 24.51 0% 100% 1% 0%
19 Racket 40.75 70,104 1496 40.98 0% 100% 0% 0%
31 PHP #3 65.72 12,940 1082 66.13 0% 100% 0% 0%
48 Erlang #3 103.00 38,132 1399 103.93 29% 0% 1% 70%
51 VW Smalltalk 107.63 54,520 1782 108.59 0% 0% 1% 100%
89 Swift #3 189.91 6,288 1204 190.84 0% 100% 0% 0%
91 Lua #4 193.86 1,456 1305 194.99 0% 72% 28% 0%
96 Lua #2 204.74 1,432 1193 205.77 100% 0% 0% 0%
106 Ruby #3 224.95 285,672 1163 234.53 2% 1% 1% 100%
107 Ruby #2 228.16 285,752 1137 230.29 37% 63% 0% 0%
109 Lua 230.83 1,452 1201 231.95 100% 0% 0% 0%
139 Swift #9 295.12 10,608 1526 296.73 92% 0% 8% 0%
226 Perl #2 8 min 6,268 1429 8 min 0% 0% 0% 100%
255 Python 3 9 min 7,780 1196 9 min 0% 100% 0% 0%
266 Python 3 #2 9 min 8,092 1242 9 min 0% 100% 0% 0%
  Matz's Ruby #2 38 min 3,816 1137 38 min 0% 0% 0% 100%
  Matz's Ruby #3 38 min 3,800 1163 39 min 1% 97% 0% 3%
F# .NET Bad Output