The Computer Language
Benchmarks Game

n-body

program source code, command-line and measurements

× source secs mem gz cpu cpu load
1.0 Fortran Intel #6 8.28 8 1524 8.28 1% 0% 0% 100%
1.1 Ada 2012 GNAT #2 9.05 1,876 2617 9.05 0% 6% 95% 1%
1.1 Fortran Intel #5 9.10 8 1664 9.09 0% 100% 0% 1%
1.1 C gcc #4 9.37 1,088 1490 9.37 100% 0% 1% 0%
1.1 C++ g++ #3 9.42 1,704 1763 9.41 2% 100% 1% 0%
1.2 C++ g++ #8 10.29 1,084 1544 10.29 0% 100% 0% 0%
1.3 C++ g++ #7 10.44 1,084 1545 10.44 0% 100% 1% 0%
1.5 C++ g++ #5 12.30 1,768 1749 12.30 0% 1% 1% 100%
1.6 Rust #2 13.27 1,796 1805 13.26 0% 1% 1% 100%
1.6 Rust 13.47 1,832 1480 13.47 0% 100% 1% 0%
2.2 Ada 2012 GNAT #5 17.95 1,880 2447 17.94 100% 2% 1% 0%
2.2 Rust #4 18.48 1,816 1803 18.47 0% 0% 1% 100%
2.4 Fortran Intel 19.53 8 1393 19.53 0% 100% 1% 0%
2.4 C++ g++ 19.67 1,084 1659 19.66 100% 0% 1% 0%
2.4 Fortran Intel #2 19.71 8 1500 19.70 100% 0% 0% 0%
2.4 Rust #5 20.09 1,804 2220 20.09 0% 100% 1% 0%
2.4 C++ g++ #6 20.11 1,088 1668 20.11 100% 1% 1% 0%
2.4 Rust #3 20.20 1,812 1540 20.20 0% 100% 1% 0%
2.4 C gcc 20.26 1,088 1173 20.26 0% 100% 1% 0%
2.5 C++ g++ #4 20.30 824 1428 20.30 0% 0% 1% 100%
2.5 Rust #6 20.33 1,824 1790 20.33 0% 0% 1% 100%
2.5 C gcc #6 20.82 1,088 1180 20.82 1% 0% 0% 100%
2.5 Go #3 21.00 1,536 1200 21.00 0% 100% 0% 1%
2.6 Go 21.38 1,472 1310 21.38 0% 0% 0% 100%
2.6 C# .NET Core #7 21.41 36,520 1542 21.41 28% 0% 1% 72%
2.6 Fortran Intel #4 21.56 8 1179 21.56 100% 0% 0% 0%
2.6 C gcc #2 21.63 1,084 1263 21.62 1% 100% 0% 0%
2.6 OCaml 21.68 1,520 1251 21.68 1% 0% 100% 0%
2.6 C# .NET Core #5 21.74 36,536 1534 21.74 1% 100% 1% 0%
2.6 C# .NET Core #3 21.75 36,456 1305 21.75 1% 100% 0% 1%
2.6 Swift #4 21.80 18,344 1357 21.79 100% 1% 1% 0%
2.7 Haskell GHC #2 21.99 3,984 1883 86.80 99% 98% 100% 99%
2.7 Java  #4 22.00 32,272 1489 22.07 1% 0% 0% 100%
2.7 C# .NET Core #8 22.02 36,596 1343 22.02 1% 100% 2% 1%
2.7 Java #5 22.14 32,368 1429 22.21 0% 100% 1% 0%
2.7 C# .NET Core #2 22.14 36,432 1410 22.15 100% 1% 1% 1%
2.7 Go #2 22.28 1,472 1215 22.28 0% 100% 1% 0%
2.7 Swift #5 22.28 7,172 1253 22.28 0% 76% 25% 0%
2.7 Free Pascal 22.36 8 1325 22.35 1% 0% 0% 100%
2.7 Fortran Intel #3 22.36 8 1305 22.35 100% 0% 0% 0%
2.7 C# .NET Core 22.46 36,516 1403 22.46 1% 1% 1% 100%
2.7 C# .NET Core #4 22.48 36,552 1404 22.49 100% 1% 1% 0%
2.7 Java #3 22.54 32,408 1430 22.61 0% 100% 2% 0%
2.7 C gcc #7 22.69 1,084 1244 22.68 0% 0% 0% 100%
2.7 Free Pascal #2 22.75 8 1339 22.75 100% 1% 0% 0%
2.8 Julia 22.80 163,976 1319 23.01 100% 1% 1% 1%
2.8 Java 22.86 33,108 1430 22.94 0% 100% 1% 0%
2.8 F# .NET Core #2 22.90 38,416 1381 22.90 0% 0% 1% 100%
2.8 Swift #7 23.40 15,996 1445 23.39 0% 0% 1% 100%
2.8 C gcc #3 23.45 1,088 1208 23.44 100% 0% 1% 0%
2.9 Ada 2012 GNAT #3 23.78 1,944 1750 23.78 0% 0% 1% 100%
2.9 Swift #8 23.80 18,420 1346 23.79 1% 100% 0% 0%
2.9 C gcc #5 23.80 824 1429 23.80 100% 0% 1% 0%
2.9 Haskell GHC 23.83 3,888 1706 94.19 99% 99% 99% 100%
2.9 Chapel 23.94 5,068 962 23.93 100% 1% 1% 0%
2.9 Swift #6 24.02 7,112 1194 24.01 1% 100% 0% 0%
2.9 F# .NET Core #3 24.11 37,968 1617 24.12 0% 1% 100% 0%
3.0 C# .NET Core #6 24.60 36,392 1289 24.61 100% 1% 1% 1%
3.0 Free Pascal #3 24.93 8 1435 24.92 0% 100% 1% 1%
3.0 Java #2 25.04 32,352 1424 25.11 0% 100% 0% 1%
3.0 F# .NET Core 25.12 68,852 1267 25.15 91% 1% 1% 9%
3.1 Substrate VM #4 25.54 6,500 1489 25.53 1% 0% 0% 100%
3.1 Substrate VM #3 26.05 6,536 1430 26.04 0% 1% 100% 0%
3.2 Substrate VM #2 26.25 6,536 1424 26.24 0% 100% 1% 0%
3.2 Lisp SBCL #2 26.25 17,500 1403 26.24 100% 1% 1% 0%
3.2 Node js 26.28 33,292 1297 26.28 0% 0% 100% 0%
3.2 Substrate VM 26.33 5,036 1430 26.33 100% 0% 1% 0%
3.3 TypeScript #3 27.12 33,128 1348 27.12 0% 0% 100% 0%
3.3 Dart app-jit #3 27.38 73,928 1409 27.51 0% 100% 1% 0%
3.4 Ada 2012 GNAT 28.16 1,884 1618 28.15 100% 0% 0% 0%
3.5 Dart #3 28.81 121,680 1409 29.27 1% 99% 1% 1%
3.5 Node js #5 28.99 32,928 1193 28.98 0% 100% 1% 0%
3.6 Substrate VM #5 30.05 6,488 1429 30.05 0% 0% 0% 100%
3.8 Node js #4 31.52 33,188 1279 31.52 0% 100% 1% 0%
3.8 Swift #2 31.75 7,172 1192 31.74 100% 0% 0% 0%
4.1 Dart app-jit #2 34.16 77,404 1264 34.30 100% 1% 1% 0%
4.6 Node js #2 37.77 32,904 1537 37.77 0% 0% 100% 0%
5.0 Dart #2 41.18 115,612 1264 41.62 1% 65% 35% 1%
5.0 Lisp SBCL 41.45 17,468 1368 41.44 0% 100% 1% 0%
5.1 Truffle Ruby #2 42.28 343,684 1137 58.67 14% 98% 15% 13%
5.7 Julia #2 46.86 216,640 1307 47.12 1% 0% 100% 1%
6.5 Racket #2 54.19 44,488 1689 54.15 100% 0% 1% 0%
8.9 TypeScript 74.07 34,828 1462 74.43 62% 1% 1% 38%
9.4 TypeScript #2 78.23 34,604 1453 78.66 72% 1% 1% 28%
11 Racket 89.17 44,308 1496 89.07 0% 0% 100% 0%
23 VW Smalltalk 191.98 54,500 1824 191.93 0% 100% 0% 0%
23 Erlang HiPE #3 193.34 23,508 1399 193.35 0% 0% 1% 99%
25 Swift #3 206.77 7,016 1204 206.73 100% 0% 0% 0%
27 JRuby #2 222.49 809,600 1137 235.42 21% 35% 38% 13%
40 PHP #3 5 min 9,400 1082 5 min 44% 30% 1% 27%
47 Ruby #2 6 min 16,440 1137 7 min 13% 90% 6% 3%
48 Lua #4 6 min 1,396 1305 6 min 0% 6% 94% 1%
50 Lua #2 6 min 1,344 1193 6 min 74% 0% 0% 27%
53 Lua 7 min 1,348 1201 7 min 1% 0% 100% 0%
90 Perl #2 12 min 5,532 1429 12 min 71% 0% 1% 29%
103 Python 3 #2 14 min 7,916 1242 14 min 0% 0% 0% 100%
106 Python 3 14 min 7,920 1196 14 min 27% 47% 8% 21%
536 Matz's Ruby #2 1h 13 min 3,856 1137 1h 13 min 0% 0% 99% 1%
C# .NET Core #9 Bad Output