Python Interpreters Benchmarks
x64 ArchLinux : AMD® Ryzen 7 4700U®

 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 3.373.3964,9921337  99% 1% 0% 0% 0% 1% 0% 1%
1.0PyPy 3 3.403.4260,7441315  0% 99% 0% 0% 1% 0% 0% 0%
1.6Graal 5.695.55491,2641315  12% 98% 10% 7% 12% 12% 11% 7%
2.6Cython 8.788.798,0161392  0% 0% 0% 0% 0% 1% 0% 100%
8.8Python development version 29.8429.858,1321315  0% 0% 0% 0% 0% 1% 100% 0%
9.5Nuitka 32.2432.259,5161315  0% 0% 0% 100% 1% 0% 0% 0%
11Python 3 38.1938.198,0921315  19% 16% 100% 13% 14% 14% 12% 12%
11Python 2 38.7838.786,6841337  0% 0% 0% 0% 0% 1% 0% 100%
13Jython 47.8942.473,3801337  13% 32% 42% 14% 3% 4% 2% 4%
26MicroPython 89.1589.174,5201315  0% 0% 0% 100% 0% 1% 0% 0%
missing benchmark programs
IronPython No program
Shedskin No program
Numba No program
Pyston 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