n-body hypotheses non fingo

↓ Double-precision N-body simulation, N=20,000,000.

Which program used most Memory? Which used least Code? Sort the data. Find several programs written for the same language implementation - how different are Time-used, Memory-used, Code-used? Which programs use highly optimised assembly code libraries? Which programs make use of all the processor cores?

    sort sort sort sort
  ×   Program & Logs CPU secs Elapsed secs Memory KB Code B ~ CPU Load
1.0C++ GNU g++ #2 12.789361705  
1.1Oberon-2 OO2C 14.273,1161465  
1.1Eiffel SmartEiffel 14.335321465  
1.2GNU gcc 15.403,1001173  
1.2C++ GNU g++ 15.558641349  
1.3GNU 17.183,0881308  
1.4Clean 17.365081722  
1.4Objective-C GNU 17.383,1001489  
1.4Digital Mars 17.393,0881308  
1.4GNU #2 17.433,0881193  
1.4Lisp SBCL 17.729,1001363  
1.4Java GNU gcj 18.0021,2001430  
1.4Digital Mars #2 18.233,0881193  
1.5Java 6 -client 18.6712,2281430  
1.6Pascal Free Pascal 19.823,1041308  
1.6Fortran G95 19.993,0961389  
1.6Ada 2005 GNAT 20.181,2361608  
1.6SML MLton #2 20.423,1161327  
1.8SML SML/NJ 22.813,5841314  
1.8C# Mono #2 23.225,2361410  
1.9Dylan Gwydion 24.372,2681543  
2.1Haskell GHC #4 27.382,0121687  
2.2Java 1.4 -server 27.4910,3001404  
2.2Java 6 -server 27.5410,8881430  
2.2Scala #2 28.5115,4761430  
2.3Haskell GHC 29.833,0961687  
2.5Nice #2 31.7814,1681313  
2.5Nice 32.2714,1721304  
2.6C# Mono 32.925,2321403  
2.7Icon 34.413,9881287  
2.8OCaml 35.656201239  
2.8Tiny 36.234001173  
11Erlang HiPE #3 135.704,4801399  
13Python Psyco #4 167.193,7081185  
23Forth GNU GForth 292.208881304  
25Scheme Chicken 5 min3,0881394  
26Scheme Chicken #3 5 min3,0881337  
29Rexx Regina 6 min48,6241517  
36Parrot PIR #2 7 min4,2161976  
44Lua #2 9 min8,2961265  
49Java 6 -Xint 10 min8,6761430  
50OCaml (bytecode) 10 min1,1721239  
95Mozart/Oz 20 min4,8201444  
100Scheme Bigloo 21 min5,3961549  
106Python CPython #2 22 min3,1401027  
111JavaScript JavaScriptCore 23 min3,1121287  
121Smalltalk GNU 25 min6,9121657  
123Perl 26 min1,9041140  
127Python CPython 26 min3,1401072  
184Parrot PIR 39 min4,2481713  
186Python IronPython 39 min16,4001072  
191JavaScript SpiderMonkey 40 min66,5801287  
194Python IronPython #2 41 min17,1561027  
197S-Lang 41 min1,3241357  
217PHP 46 min6,2681289  
264Tcl #2 56 min1,5001454  
277Scheme PLT 58 min4,7641544  
390Ruby MRI #2 1h 22 min1,7121137  
585Prolog SWI 2h 04 min2,5401586  
Dylan Gwydion #2 Failed1544
Forth bigForth Failed1359
Io Failed1106
Pike Failed1260
Scheme Bigloo #2 Failed1695
interesting alternative programs
 Tiny #2 Failed  1186
1.1GNU gcc #2 14.670.003,1041186
59S-Lang #2 750.430.001,3441439
missing programs
Cyclone No program
Matlab GNU Octave No program

 Double-precision N-body simulation

ndiff program output N = 1000 with this output file to check your program is correct before contributing.

Each program should model the orbits of Jovian planets, using the same simple symplectic-integrator - see the Java program.

For background information see N-body problem. Useful symplectic integrators are freely available, for example the HNBody Symplectic Integration Package.

Thanks to Mark C. Lewis for this benchmark.

Revised BSD license