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 3 3.193.1967,4641315  0% 0% 100% 0% 0% 1% 0% 1%
1.0PyPy 2 3.293.2974,8561337  0% 100% 1% 0% 1% 1% 1% 1%
1.1Graal 4.313.45745,9041315  81% 8% 0% 10% 13% 0% 10% 6%
2.6Cython 8.338.338,9441392  0% 100% 0% 0% 1% 0% 0% 1%
6.1Python development version 19.4219.428,9921315  70% 0% 0% 0% 30% 1% 0% 1%
6.5Python 3 20.6920.7010,5841315  1% 0% 0% 0% 0% 100% 0% 1%
8.5Nuitka 27.0927.1011,1361315  2% 1% 0% 0% 1% 0% 100% 0%
12Python 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%
13Numba 42.5942.63148,1161347  30% 67% 10% 9% 37% 16% 10% 15%
30MicroPython 96.2796.284,5081315  1% 1% 1% 1% 100% 0% 1% 1%
missing benchmark programs
IronPython 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