n-body benchmark N=5,000,000

Each chart bar shows how many times slower, one ↓ n-body program was, compared to the fastest program.

These are not the only programs that could be written. These are not the only compilers and interpreters. These are not the only programming languages.

Column × shows how many times more each program used compared to the benchmark program that used least.

    sort sortsort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1.0PyPy 2 6.346.3776,3281337  8% 100% 4% 3%
1.0PyPy 2 6.386.4076,3281337  8% 89% 3% 15%
1.0PyPy 2 6.476.4976,3361337  8% 100% 4% 3%
1.0PyPy 3 6.546.5769,5041315  8% 74% 4% 30%
1.1PyPy 3 6.756.7869,5521315  9% 4% 99% 5%
1.1PyPy 3 6.796.8269,3321315  14% 10% 100% 9%
1.2Graal 7.737.46500,7081315  8% 7% 98% 5%
1.2Graal 7.807.51500,4401315  8% 8% 100% 5%
1.2Graal 7.897.60500,6521315  13% 15% 93% 10%
1.9Cython 11.8611.888,6241392  9% 80% 5% 25%
1.9Cython 12.0112.038,5841392  8% 37% 67% 5%
1.9Cython 12.0412.068,6001392  8% 3% 100% 3%
4.6Pyston 29.4429.4526,5961337  0% 53% 0% 47%
4.6Pyston 29.4929.4926,6481337  0% 0% 100% 0%
4.9Pyston 31.0531.0626,7241337  2% 0% 98% 0%
5.4Nuitka 34.2234.259,4401315  1% 8% 100% 2%
5.5Nuitka 35.0935.139,6281315  4% 6% 1% 100%
5.7Nuitka 36.5336.569,3001315  57% 8% 45% 1%
6.9Python development version 44.0844.138,8121315  8% 65% 1% 29%
6.9Python 3 44.1744.208,8561315  7% 4% 3% 100%
6.9Python development version 44.2244.258,8241315  10% 2% 92% 0%
7.0Python 3 44.2944.338,7961315  7% 100% 3% 4%
7.1Python development version 44.9344.968,8201315  2% 6% 95% 1%
7.1Python 3 45.0545.108,7561315  13% 7% 7% 100%
7.7Python 2 48.9348.956,7401337  1% 0% 0% 100%
8.0Python 2 50.9450.996,6161337  2% 17% 80% 6%
8.4Python 2 53.1753.336,6921337  30% 28% 64% 20%
8.6IronPython 55.2154.6763,0401337  0% 66% 0% 34%
8.7IronPython 55.0055.1965,2081337  69% 7% 11% 12%
8.9IronPython 56.3756.6963,3241337  30% 0% 68% 0%
9.2Numba 58.4358.4497,4921333  0% 100% 0% 0%
9.4Numba 59.6259.6297,3761333  0% 26% 0% 74%
9.4Numba 59.7460.0196,7361333  0% 0% 100% 0%
11Jython 71.2367.65297,4361337  28% 28% 24% 26%
11Jython 72.5868.57297,2521337  34% 21% 30% 21%
11Jython 74.2070.26299,0881337  20% 25% 33% 28%
16MicroPython 104.45104.604,6841315  0% 12% 0% 88%
16MicroPython 104.54104.694,5441315  0% 0% 0% 100%
16MicroPython 104.71104.794,6841315  0% 0% 100% 0%
missing benchmark programs
Shedskin No program
Grumpy No program

 n-body benchmark : Double-precision N-body simulation

ndiff -abserr 1.0e-8 program output N = 1000 with this output file to check your program is correct before contributing.

We are trying to show the performance of various programming language implementations - so we ask that contributed programs not only give the correct result, but also use the same algorithm to calculate that result.

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

  Home   Conclusions   License   Play