The Computer Language
Benchmarks Game

n-body

program source code, command-line and measurements

× source secs KB gz cpu cpu load
1.0 C++ g++ #7 9.13 876 1545 9.12 0% 0% 100% 1%
1.0 C++ g++ #8 9.14 796 1544 9.13 1% 100% 0% 0%
1.1 C gcc #4 10.39 736 1490 10.38 0% 100% 1% 1%
1.2 Fortran Intel #5 10.76 520 1659 10.75 1% 0% 100% 1%
1.4 C++ g++ #5 12.49 1,208 1749 12.48 100% 0% 0% 1%
1.7 Rust #2 15.19 6,316 1799 15.18 1% 0% 100% 1%
2.0 Ada 2005 GNAT #5 18.05 1,632 2436 18.04 1% 0% 0% 100%
2.2 C++ g++ #3 19.88 1,228 1763 19.87 1% 0% 0% 100%
2.2 C++ g++ #6 20.12 808 1668 20.11 1% 2% 1% 100%
2.2 C gcc 20.19 716 1173 20.19 0% 0% 100% 0%
2.2 C++ g++ #4 20.31 628 1428 20.30 1% 0% 0% 100%
2.2 Fortran Intel #2 20.54 524 1496 20.53 0% 1% 1% 100%
2.3 C++ g++ 20.58 804 1659 20.57 0% 100% 1% 0%
2.3 C gcc #6 20.60 788 1180 20.59 1% 0% 100% 0%
2.3 Fortran Intel 20.91 520 1389 20.90 1% 0% 0% 100%
2.3 C gcc #5 21.08 580 1429 21.07 1% 0% 0% 100%
2.3 C gcc #3 21.31 784 1208 21.30 1% 100% 0% 0%
2.5 Fortran Intel #4 22.61 520 1172 22.60 1% 0% 100% 1%
2.6 C# Mono LLVM #2 23.36 38,684 1410 23.35 0% 100% 1% 0%
2.6 Scala 23.40 28,832 1358 23.45 1% 1% 100% 1%
2.7 Java  #2 24.31 24,156 1424 24.34 1% 1% 1% 100%
2.7 Rust 24.39 6,228 1474 24.38 0% 100% 1% 0%
2.7 Ada 2005 GNAT 24.83 1,724 1608 24.82 1% 0% 0% 100%
2.8 Fortran Intel #3 25.23 516 1299 25.22 0% 1% 100% 0%
2.8 C gcc #2 25.28 728 1263 25.27 100% 0% 1% 0%
2.8 Ada 2005 GNAT #3 25.60 1,712 1740 25.59 0% 0% 100% 0%
2.9 F# Mono LLVM 26.19 46,636 1259 26.18 0% 1% 1% 100%
3.6 Haskell GHC #2 32.71 12,292 1874 33.45 1% 1% 100% 1%
3.6 Clojure 33.26 54,276 2324 34.60 98% 2% 2% 3%
3.8 Pascal Free Pascal 34.70 8 1308 34.69 1% 0% 100% 0%
3.9 Go 36.01 1,608 1310 36.03 0% 69% 31% 1%
4.0 Clojure #2 36.83 54,680 1440 38.10 98% 2% 3% 1%
4.1 Pascal Free Pascal #2 37.22 8 1322 37.20 0% 1% 1% 100%
4.2 Lisp SBCL #2 38.13 14,636 1398 38.12 0% 100% 1% 0%
4.2 Dart #2 38.23 20,216 1274 38.56 1% 100% 1% 1%
4.2 C# Mono LLVM 38.79 39,096 1403 38.78 1% 100% 0% 0%
4.5 Haskell GHC 41.05 8,080 1706 43.00 3% 100% 2% 2%
5.1 Lisp SBCL 46.85 14,676 1363 46.83 0% 1% 0% 100%
5.2 Pascal Free Pascal #3 47.19 8 1418 47.18 0% 1% 1% 100%
5.6 Dart #3 51.53 21,824 1420 51.97 23% 77% 1% 1%
6.1 Racket #2 56.13 21,428 1689 56.14 0% 1% 1% 100%
8.2 OCaml 75.25 600 1239 75.23 1% 0% 0% 100%
13 Racket 118.10 22,624 1496 118.10 1% 1% 100% 1%
29 Erlang HiPE #3 269.30 27,776 1399 269.21 53% 1% 1% 47%
74 PHP #3 11 min 2,592 1082 11 min 0% 1% 1% 100%
83 Ruby JRuby #2 12 min 275,588 1137 12 min 27% 23% 24% 29%
110 Python 3 #2 16 min 6,444 1228 16 min 100% 1% 0% 1%
113 Python 3 17 min 6,400 1181 17 min 35% 63% 4% 1%
135 Perl #2 20 min 2,552 1401 20 min 1% 0% 0% 100%
163 Ruby #2 24 min 5,084 1137 24 min 22% 0% 79% 1%
C# Mono LLVM #8 Failed
C# Mono LLVM #5 Failed
C# Mono LLVM #3 Failed
C# Mono LLVM #7 Failed
C# Mono LLVM #6 Failed
C# Mono LLVM #4 Failed
Java Failed