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.

     sortsortsort
  ×   Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
1.0PyPy 3 3.233.2566,3601315  0% 0% 0% 0% 0% 0% 99% 0%
1.0PyPy 2 3.243.2668,9921337  1% 99% 0% 0% 0% 0% 0% 0%
1.3Graal 4.313.45745,9041315  81% 8% 0% 10% 13% 0% 10% 6%
2.6Cython 8.488.488,2841392  0% 0% 0% 1% 0% 1% 0% 100%
7.2Python development version 23.1623.1810,0801315  79% 21% 15% 11% 36% 15% 15% 17%
12Python 3 38.1938.198,0921315  19% 16% 100% 13% 14% 14% 12% 12%
12Python 2 38.7838.786,6841337  0% 0% 0% 0% 0% 1% 0% 100%
13Numba 42.5942.63148,1161347  30% 67% 10% 9% 37% 16% 10% 15%
15Jython 47.8942.473,3801337  13% 32% 42% 14% 3% 4% 2% 4%
28MicroPython 89.1589.174,5201315  0% 0% 0% 100% 0% 1% 0% 0%
missing benchmark programs
IronPython No program
Nuitka No program
Shedskin 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