n-body benchmark N=5,000,000

Each chart bar shows how many times more Code, one ↓ n-body program used, compared to the program that used least Code.

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.

    sortsortsort 
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1.0MicroPython 104.84109.374,4721315  1% 97% 2% 4%
1.0Graal 6.756.60406,5601315  13% 80% 11% 7%
1.0MicroPython 105.20109.114,4001315  7% 84% 14% 4%
1.0Graal 6.806.69406,5481315  22% 1% 83% 6%
1.0MicroPython 104.92107.864,4841315  32% 65% 6% 2%
1.0PyPy 3 4.864.8968,8361315  15% 14% 95% 9%
1.0Python 3 47.6449.448,9321315  36% 79% 17% 17%
1.0Graal 6.876.81406,5641315  46% 4% 58% 4%
1.0Python development version 45.7345.768,1161315  7% 8% 2% 94%
1.0Python development version 45.6345.668,0001315  7% 9% 2% 93%
1.0Python development version 46.4546.487,9561315  6% 20% 1% 81%
1.0PyPy 3 4.854.8868,8401315  100% 16% 13% 10%
1.0PyPy 3 4.604.8268,9401315  3% 99% 5% 3%
1.0Python 3 45.7445.888,9841315  48% 7% 55% 2%
1.0Nuitka 38.9739.019,7641315  62% 1% 39% 1%
1.0Nuitka 39.4539.489,8321315  1% 1% 1% 100%
1.0Nuitka 39.0239.059,6721315  1% 39% 1% 62%
1.0Python 3 44.7145.218,8281315  37% 30% 44% 11%
1.0Numba 59.6259.6297,3761333  0% 26% 0% 74%
1.0Numba 59.7460.0196,7361333  0% 0% 100% 0%
1.0Numba 58.4358.4497,4921333  0% 100% 0% 0%
1.0Jython 72.5868.57297,2521337  34% 21% 30% 21%
1.0Jython 71.2367.65297,4361337  28% 28% 24% 26%
1.0Pyston 29.4429.4526,5961337  0% 53% 0% 47%
1.0PyPy 2 5.105.2175,0401337  20% 55% 21% 68%
1.0PyPy 2 5.185.3875,2441337  31% 77% 17% 38%
1.0PyPy 2 4.944.9775,2361337  12% 16% 17% 100%
1.0IronPython 55.0055.1965,2081337  69% 7% 11% 12%
1.0IronPython 56.3756.6963,3241337  30% 0% 68% 0%
1.0IronPython 55.2154.6763,0401337  0% 66% 0% 34%
1.0Pyston 29.4929.4926,6481337  0% 0% 100% 0%
1.0Pyston 31.0531.0626,7241337  2% 0% 98% 0%
1.0Jython 74.2070.26299,0881337  20% 25% 33% 28%
1.0Python 2 48.9348.956,7401337  1% 0% 0% 100%
1.0Python 2 50.9450.996,6161337  2% 17% 80% 6%
1.0Python 2 53.1753.336,6921337  30% 28% 64% 20%
1.1Cython 10.0210.038,3441392  3% 1% 100% 2%
1.1Cython 10.0910.108,6241392  1% 1% 2% 100%
1.1Cython 10.0110.028,4201392  2% 100% 1% 2%
missing benchmark programs
Shedskin No program
Grumpy No program
RustPython 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