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 low-level programs written for SIMD.

× source secs mem gz busy cpu load
1.0 Rust #8 3.31 836 1767 3.36 100% 1% 0% 1%
1.0 Rust #7 3.39 840 1753 3.80 100% 12% 0% 0%
1.1 Rust #2 3.75 840 1805 3.76 100% 0% 0% 0%
1.2 Rust 3.93 836 1480 3.97 0% 100% 1% 1%
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 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 896 2220 4.86 100% 0% 0% 0%
1.5 C# .NET #2 4.86 32,760 1742 4.96 0% 1% 100% 2%
1.5 Swift #7 4.89 10,240 1326 4.95 0% 100% 1% 0%
1.5 Rust #4 4.91 832 1803 4.93 100% 0% 0% 0%
1.5 Swift #5 5.00 10,240 1365 5.02 0% 0% 100% 0%
1.5 Rust #6 5.05 832 1790 5.06 100% 0% 0% 0%
1.5 Ada 2012 GNAT #2 5.13 1,980 2617 5.16 100% 0% 0% 0%
1.6 Swift #4 5.16 10,308 1355 5.18 0% 0% 0% 100%
1.6 Rust #3 5.25 840 1540 5.29 100% 0% 0% 0%
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.6 Swift #8 5.43 10,324 1681 5.48 0% 0% 100% 1%
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.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 C gcc #5 6.09 796 1429 6.13 100% 0% 0% 0%
1.9 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 Swift #6 6.26 7,212 1194 6.29 0% 100% 0% 0%
1.9 Free Pascal #2 6.28 8 1339 6.33 100% 0% 0% 0%
1.9 Free Pascal 6.28 8 1325 6.29 0% 100% 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,800 1200 6.44 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.65 1,732 1310 6.70 0% 0% 100% 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,252 1215 6.94 1% 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 Haskell GHC #2 6.95 4,196 1883 26.83 95% 95% 95% 100%
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 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.3 Haskell GHC 7.61 4,252 1706 29.48 96% 100% 96% 96%
2.4 Java 7.80 37,588 1430 7.88 100% 1% 0% 0%
2.4 Lisp SBCL #2 7.81 18,352 1403 7.81 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.36 34,332 1268 8.37 0% 0% 0% 100%
2.5 Dart #3 8.44 124,928 1409 8.55 1% 98% 1% 1%
2.6 Swift #3 8.65 7,176 1204 8.68 100% 0% 0% 0%
2.7 Ada 2012 GNAT #5 8.99 1,976 2447 9.20 0% 0% 100% 2%
2.9 Swift #2 9.69 7,184 1192 10.16 100% 2% 2% 0%
3.5 Dart #2 11.47 147,188 1264 11.86 1% 1% 2% 99%
4.0 Lisp SBCL 13.15 18,332 1368 13.19 0% 100% 0% 0%
7.2 Julia #2 23.90 256,696 1078 24.26 1% 1% 100% 1%
7.7 Racket #2 25.38 38,392 1689 25.92 100% 0% 1% 1%
13 Racket 44.55 39,604 1496 45.65 1% 1% 1% 100%
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%
66 Lua #2 217.77 1,288 1193 218.86 0% 0% 0% 100%
66 Lua #4 220.07 1,224 1305 221.34 0% 0% 0% 100%
72 Lua 238.34 1,232 1201 241.76 0% 0% 1% 100%
77 Ruby #2 253.50 25,232 1137 258.38 1% 1% 0% 100%
84 Swift #9 278.16 10,116 1526 279.49 0% 0% 100% 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%
693 Matz's Ruby #2 38 min 3,952 1137 1h 18 min 78% 12% 75% 40%
F# .NET Bad Output