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 | sort | sort | ||||
× | Program Source Code | CPU secs | Elapsed secs | Memory KB | Code B | ≈ CPU Load |
---|---|---|---|---|---|---|
1.0 | PyPy 3 | 3.19 | 3.19 | 67,464 | 1315 | 0% 0% 100% 0% 0% 1% 0% 1% |
1.0 | PyPy 2 | 3.29 | 3.29 | 74,856 | 1337 | 0% 100% 1% 0% 1% 1% 1% 1% |
1.1 | Graal | 4.31 | 3.45 | 745,904 | 1315 | 81% 8% 0% 10% 13% 0% 10% 6% |
2.6 | Cython | 8.33 | 8.33 | 8,944 | 1392 | 0% 100% 0% 0% 1% 0% 0% 1% |
6.1 | Python development version | 19.42 | 19.42 | 8,992 | 1315 | 70% 0% 0% 0% 30% 1% 0% 1% |
6.5 | Python 3 | 20.69 | 20.70 | 10,584 | 1315 | 1% 0% 0% 0% 0% 100% 0% 1% |
8.5 | Nuitka | 27.09 | 27.10 | 11,136 | 1315 | 2% 1% 0% 0% 1% 0% 100% 0% |
12 | Python 2 | 38.78 | 38.78 | 6,684 | 1337 | 0% 0% 0% 0% 0% 1% 0% 100% |
13 | Jython | 47.89 | 42.47 | 3,380 | 1337 | 13% 32% 42% 14% 3% 4% 2% 4% |
13 | Numba | 42.59 | 42.63 | 148,116 | 1347 | 30% 67% 10% 9% 37% 16% 10% 15% |
30 | MicroPython | 96.27 | 96.28 | 4,508 | 1315 | 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 |
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.