The Computer Language
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.

× source secs mem gz busy cpu load
1.0 Rust #8 3.31 844 1767 3.32 0% 0% 0% 100%
1.0 Rust #7 3.39 840 1753 3.41 0% 0% 100% 1%
1.1 Rust #2 3.75 844 1805 3.78 1% 0% 0% 100%
1.2 Julia #7 4.00 212,108 1112 4.30 99% 3% 3% 3%
1.2 C++ g++ #7 4.09 1,800 1808 4.13 100% 0% 0% 0%
1.2 Julia #6 4.09 213,168 1430 4.38 3% 2% 2% 99%
1.2 C++ g++ #2 4.09 1,688 1879 4.15 100% 0% 1% 0%
1.2 C++ g++ #8 4.10 1,060 1765 4.12 100% 0% 0% 0%
1.2 C++ g++ #3 4.11 1,744 1763 4.11 100% 0% 0% 0%
1.3 Intel Fortran #6 4.22 12 1524 4.34 100% 1% 1% 2%
1.3 C gcc #8 4.30 8 1391 4.32 0% 0% 0% 100%
1.3 Rust #6 4.31 848 1790 4.34 0% 0% 100% 1%
1.3 C++ g++ #9 4.36 1,060 1773 4.41 0% 100% 1% 0%
1.3 C gcc #4 4.39 1,060 1490 4.41 0% 0% 0% 100%
1.5 Rust #5 4.84 844 2220 4.92 0% 1% 100% 0%
1.5 C# .NET #2 4.86 32,760 1742 4.96 0% 1% 100% 2%
1.5 Ada 2012 GNAT #2 5.13 1,980 2617 5.16 100% 0% 0% 0%
1.6 Swift #7 5.32 13,444 1326 5.39 0% 0% 100% 1%
1.6 Swift #5 5.33 13,372 1365 5.36 0% 0% 100% 0%
1.6 Swift #4 5.34 13,368 1355 5.37 0% 100% 0% 0%
1.6 Rust #4 5.35 848 1803 5.38 0% 0% 0% 100%
1.6 Intel Fortran #2 5.38 12 1500 5.61 1% 1% 2% 100%
1.6 Intel Fortran 5.42 12 1393 5.63 100% 0% 1% 2%
1.7 Julia #4 5.65 181,292 1155 5.94 2% 100% 2% 2%
1.7 C++ g++ #4 5.68 740 1428 5.69 0% 0% 0% 100%
1.7 C++ g++ #6 5.69 1,060 1668 5.73 0% 0% 0% 100%
1.7 Rust #3 5.69 844 1540 5.75 0% 0% 100% 1%
1.7 Swift #8 5.70 10,232 1681 5.70 100% 0% 0% 0%
1.8 Rust 5.85 908 1480 5.99 0% 100% 0% 2%
1.8 Intel Fortran #5 5.97 12 1664 6.22 2% 100% 0% 2%
1.8 C++ g++ 6.06 1,116 1659 6.08 0% 0% 100% 0%
1.8 Swift #6 6.06 7,292 1194 6.09 0% 0% 0% 100%
1.8 C gcc #5 6.09 796 1429 6.13 100% 0% 0% 0%
1.8 C++ g++ #5 6.13 1,744 1749 6.14 0% 100% 0% 0%
1.9 Intel Fortran #4 6.18 12 1179 6.38 1% 2% 100% 1%
1.9 Free Pascal 6.28 8 1325 6.29 0% 100% 0% 0%
1.9 Free Pascal #2 6.28 8 1339 6.33 100% 0% 0% 0%
1.9 Intel Fortran #3 6.32 12 1305 6.54 0% 1% 2% 100%
1.9 C gcc #7 6.35 1,064 1244 6.43 100% 1% 0% 0%
1.9 Go #3 6.38 1,896 1200 6.43 0% 100% 1% 0%
1.9 Haskell GHC #2 6.42 4,176 1883 6.47 0% 0% 0% 100%
1.9 C gcc #6 6.45 1,120 1180 6.49 0% 0% 0% 100%
2.0 C gcc #2 6.62 1,120 1263 6.80 100% 1% 0% 2%
2.0 Go 6.66 1,860 1310 6.89 0% 100% 3% 0%
2.0 OCaml 6.72 1,464 1251 6.76 0% 100% 0% 1%
2.0 Java  #4 6.75 35,200 1489 6.83 0% 0% 100% 1%
2.0 Julia #3 6.76 187,672 1541 7.04 2% 2% 1% 100%
2.0 Chapel #2 6.79 5,388 971 7.09 100% 1% 0% 3%
2.1 C gcc 6.88 1,056 1173 6.90 0% 0% 100% 0%
2.1 Go #2 6.88 1,860 1215 6.91 0% 0% 0% 100%
2.1 F# .NET #3 6.88 34,744 1617 6.92 0% 100% 1% 0%
2.1 C# .NET #3 6.91 32,912 1305 7.12 0% 100% 3% 0%
2.1 Java #5 6.98 35,560 1429 7.04 100% 0% 1% 0%
2.1 F# .NET #4 7.04 29,788 1290 7.12 100% 1% 1% 0%
2.1 C# .NET #8 7.08 32,728 1343 7.22 1% 100% 1% 0%
2.2 Free Pascal #3 7.16 8 1435 7.19 0% 0% 0% 100%
2.2 Haskell GHC 7.16 4,024 1706 7.18 100% 0% 0% 0%
2.2 C gcc #3 7.18 1,116 1208 7.22 0% 100% 1% 0%
2.2 Ada 2012 GNAT #3 7.22 1,924 1750 7.24 0% 100% 0% 0%
2.2 F# .NET #2 7.35 34,992 1381 7.64 0% 1% 100% 3%
2.2 Java #2 7.43 35,516 1424 7.51 100% 1% 0% 0%
2.2 Java #3 7.45 35,508 1430 7.52 0% 1% 1% 99%
2.4 Java 7.80 37,588 1430 7.88 100% 1% 0% 0%
2.4 Lisp SBCL #2 7.83 17,892 1403 7.88 0% 0% 100% 0%
2.5 Ada 2012 GNAT 8.17 1,924 1618 8.19 0% 0% 0% 100%
2.5 Node js #6 8.37 35,576 1268 8.37 0% 0% 100% 0%
2.7 Ada 2012 GNAT #5 8.99 1,976 2447 9.20 0% 0% 100% 2%
2.8 Swift #2 9.12 7,288 1192 9.45 100% 0% 1% 3%
2.8 Dart #3 9.44 124,912 1408 9.78 98% 1% 2% 3%
3.9 Dart #2 12.93 149,160 1266 13.14 6% 14% 38% 44%
4.0 Lisp SBCL 13.15 17,900 1368 13.23 0% 100% 0% 0%
4.8 Racket #2 15.85 69,492 1689 15.91 0% 0% 100% 0%
7.2 Julia #2 23.90 256,696 1078 24.26 1% 1% 100% 1%
10 Racket 33.07 68,796 1496 33.19 0% 8% 0% 92%
22 PHP #3 71.75 12,072 1082 76.86 3% 1% 2% 100%
33 VW Smalltalk 108.63 55,036 1782 109.07 0% 0% 100% 0%
42 Erlang HiPE #3 140.03 24,832 1399 141.22 0% 100% 0% 0%
57 Swift #3 190.12 7,084 1204 191.33 0% 0% 0% 100%
63 Lua #4 208.01 1,240 1305 208.83 0% 0% 100% 0%
65 Lua #2 214.72 1,240 1193 220.90 1% 1% 1% 100%
68 Lua 224.00 1,236 1201 225.15 100% 0% 0% 0%
70 Ruby #2 232.08 22,968 1137 236.00 0% 1% 100% 0%
89 Swift #9 295.18 10,132 1526 296.90 100% 0% 0% 0%
127 Perl #2 6 min 6,388 1429 7 min 1% 1% 1% 100%
177 Python 3 9 min 8,012 1196 9 min 0% 0% 0% 100%
182 Python 3 #2 10 min 8,380 1242 10 min 0% 100% 0% 0%
688 Matz's Ruby #2 38 min 3,816 1137 38 min 0% 0% 0% 100%
F# .NET Bad Output