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++ #8 9.40 1,084 1544 9.39 0% 1% 1% 100%
1.0 C++ g++ #7 9.67 1,084 1545 9.67 0% 0% 1% 100%
1.0 Fortran Intel #5 9.79 516 1659 9.78 1% 0% 1% 100%
1.1 C++ g++ #3 10.28 1,536 1763 10.27 0% 0% 0% 100%
1.1 C gcc #4 10.50 1,008 1490 10.49 0% 1% 1% 100%
1.4 C++ g++ #5 13.12 1,536 1749 13.11 0% 1% 0% 100%
1.6 Rust #2 14.60 6,420 1799 14.59 1% 0% 0% 100%
1.9 Ada 2005 GNAT #5 18.01 1,956 2436 18.00 1% 0% 2% 100%
2.1 C++ g++ 19.36 1,088 1659 19.36 0% 1% 0% 100%
2.1 C++ g++ #6 19.53 1,020 1668 19.52 0% 0% 0% 100%
2.1 Fortran Intel #2 19.84 508 1496 19.83 1% 1% 0% 100%
2.1 Fortran Intel 19.95 512 1389 19.95 1% 0% 0% 100%
2.2 C++ g++ #4 20.64 728 1428 20.63 0% 0% 1% 100%
2.2 C gcc 20.74 1,012 1173 20.73 0% 0% 1% 100%
2.2 C gcc #5 21.09 748 1429 21.08 0% 0% 0% 100%
2.3 C gcc #6 21.20 1,008 1180 21.20 0% 1% 0% 100%
2.3 C gcc #3 21.29 972 1208 21.28 0% 1% 0% 100%
2.3 C# Mono LLVM #3 21.82 40,512 1305 21.81 1% 0% 0% 100%
2.3 Fortran Intel #4 21.91 512 1172 21.90 1% 0% 0% 100%
2.3 Go 22.01 1,732 1310 22.00 0% 1% 0% 100%
2.3 C# Mono LLVM #8 22.08 40,484 1343 22.07 0% 0% 0% 100%
2.4 OCaml 22.27 708 1239 22.26 1% 0% 0% 100%
2.4 C gcc #2 22.35 896 1263 22.34 0% 0% 0% 100%
2.4 Java  #2 22.68 30,056 1424 22.67 0% 0% 1% 100%
2.4 C# Mono LLVM #2 22.75 40,568 1410 22.74 1% 0% 0% 100%
2.5 Fortran Intel #3 23.10 520 1299 23.09 1% 0% 0% 100%
2.5 Haskell GHC #2 23.44 4,232 1874 23.43 1% 0% 0% 100%
2.5 Scala 23.72 46,588 1358 23.71 0% 1% 1% 100%
2.6 Rust 24.34 6,444 1474 24.33 1% 0% 0% 100%
2.6 C# Mono LLVM #6 24.53 40,532 1289 24.52 0% 1% 1% 100%
2.7 Ada 2005 GNAT #3 25.34 2,068 1740 25.34 1% 1% 0% 100%
2.7 Haskell GHC 25.46 4,192 1706 25.44 1% 0% 0% 100%
2.8 Ada 2005 GNAT 25.95 2,072 1608 25.94 1% 1% 0% 100%
2.8 F# Mono LLVM 26.42 52,784 1259 26.41 0% 1% 1% 100%
2.8 Lisp SBCL #2 26.60 17,424 1398 26.60 0% 1% 0% 100%
2.9 Clojure 27.46 69,640 2324 27.44 1% 0% 1% 100%
3.0 Dart #3 27.74 28,196 1420 27.73 1% 1% 1% 100%
3.0 Clojure #2 28.08 66,784 1440 28.07 0% 1% 1% 100%
3.0 C# Mono LLVM #7 28.21 41,464 1539 28.20 0% 1% 1% 100%
3.2 Dart #2 30.54 27,032 1274 30.52 1% 0% 0% 100%
3.3 C# Mono LLVM #4 30.85 39,680 1461 30.84 1% 0% 1% 100%
3.4 C# Mono LLVM #5 31.65 39,584 1485 31.65 0% 0% 1% 100%
3.6 JavaScript V8 33.95 11,936 1287 33.94 1% 0% 0% 100%
3.7 Pascal Free Pascal 34.76 8 1308 34.75 1% 0% 1% 100%
3.8 Pascal Free Pascal #3 35.41 8 1418 35.40 1% 1% 0% 100%
3.9 Pascal Free Pascal #2 37.02 8 1322 37.01 1% 0% 0% 100%
3.9 JavaScript V8 #2 37.11 15,744 1527 37.10 0% 0% 0% 100%
4.1 C# Mono LLVM 38.06 40,816 1403 38.04 1% 0% 1% 100%
4.4 Lisp SBCL 41.76 17,424 1363 41.74 1% 1% 0% 100%
5.9 Racket #2 55.02 32,328 1689 54.97 0% 0% 1% 100%
11 Racket 107.92 24,732 1496 107.80 0% 1% 1% 100%
20 Erlang HiPE #3 191.29 14,676 1399 191.22 0% 0% 0% 100%
21 Smalltalk VW 197.18 53,024 1652 197.12 1% 0% 0% 100%
40 Ruby JRuby #2 6 min 752,500 1137 6 min 1% 1% 1% 100%
46 Lua #4 7 min 1,080 1305 7 min 1% 0% 0% 100%
46 Lua #2 7 min 1,072 1193 7 min 3% 4% 5% 100%
57 Lua 8 min 1,068 1201 8 min 1% 0% 0% 100%
58 Hack #5 9 min 115,932 1432 9 min 0% 0% 1% 100%
70 PHP #3 10 min 3,364 1082 10 min 1% 0% 0% 100%
70 Hack 11 min 110,104 1288 11 min 1% 0% 0% 100%
73 Ruby #2 11 min 7,072 1137 11 min 1% 0% 0% 100%
100 Python 3 #2 15 min 8,112 1228 15 min 0% 1% 1% 100%
103 Python 3 16 min 8,016 1181 16 min 0% 1% 1% 100%
116 Perl #2 18 min 3,156 1401 18 min 1% 1% 0% 100%
138 Hack #3 21 min 115,624 1080 21 min 1% 0% 0% 100%
Java Failed