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

vs

 1 : Are the Cython programs faster? At a glance.

Each chart bar shows, for one unidentified benchmark, how much the fastest Cython program used compared to the fastest Python 3 program.

(Memory use is only compared for tasks that require memory to be allocated.)


These are not the only compilers and interpreters. These are not the only programs that could be written. These are not the only tasks that could be solved. These are just 10 tiny examples.

 2 : Are the Cython programs faster? Approximately.

Each table row shows, for one named benchmark, how much the fastest Cython program used compared to the fastest Python 3 program.

(Memory use is only compared for tasks that require memory to be allocated.)

 Cython used what fraction? used how many times more? 
Benchmark Time Memory Code
 iobench1/167 ±
 thread-ring1/167 ±
 fib501/4 ±
 n-body1/3 ±
 pystone1/3?±
 fasta-redux1/2?±
 richards± ±
 fasta †± 1/2
 chameneos-redux± ±
 pidigits †±?±
 reverse-complement †±?±
 jsonbench± ±
 regex-dna±?±
 templates± ±
 meteor-contest± ±
 k-nucleotide †±?1/3
 Cython used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/1671/1671/3±±±±

† possible mismatch - one-core program compared to multi-core program.

± read the measurements and then read the program source code.

 3 : Are the Cython programs faster? Measurements.

These are not the only tasks that could be solved. These are just 10 tiny examples. These are not the only compilers and interpreters. These are not the only programs that could be written.

For each named benchmark, measurements of the fastest Cython program are shown for comparison against measurements of the fastest Python 3 program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 iobench 
Cython0.020.02?366  0% 0% 0% 0% 0% 0% 100% 0%
Python 32.842.849,080367  2% 2% 0% 100% 0% 1% 1% 1%
 thread-ring 
Cython0.230.231,896419  0% 0% 100% 0% 0% 0% 0% 0%
Python 320.4538.9711,040448  4% 8% 5% 5% 4% 7% 3% 11%
 fib50 
Cython0.500.508,220159  100% 0% 0% 0% 0% 0% 0% 0%
Python 32.042.048,348136  2% 0% 0% 0% 0% 0% 100% 0%
 n-body 
Cython8.488.488,2841392  0% 0% 0% 1% 0% 1% 0% 100%
Python 328.8328.838,8441315  0% 0% 0% 0% 0% 0% 100% 0%
 pystone 
Cython0.060.07?2401  0% 100% 0% 0% 0% 0% 0% 0%
Python 30.190.19?2300  5% 5% 0% 0% 0% 100% 0% 0%
 fasta-redux 
Cython0.110.11?1169  0% 100% 0% 0% 0% 0% 0% 0%
Python 30.190.19?1115  100% 0% 0% 0% 0% 5% 0% 0%
 richards 
Cython0.520.538,2722467  0% 0% 2% 0% 100% 2% 0% 0%
Python 30.700.709,4242434  0% 0% 0% 0% 0% 100% 0% 1%
 fasta 
Cython2.102.108,772945  1% 0% 0% 0% 0% 100% 0% 0% †
Python 34.802.6663,2202016  39% 6% 54% 3% 7% 41% 32% 5% †
 chameneos-redux 
Cython265.20221.398,2321203  6% 9% 7% 6% 8% 7% 10% 8%
Python 3182.63264.5514,7841191  5% 3% 3% 2% 12% 11% 12% 11%
 pidigits 
Cython0.020.02?349  0% 0% 100% 0% 0% 0% 0% 0% †
Python 30.020.02?379  25% 0% 0% 33% 0% 0% 0% 100% †
 reverse-complement 
Cython0.020.02?458  0% 0% 0% 100% 0% 0% 0% 0% †
Python 30.020.02?449  0% 33% 100% 0% 0% 0% 0% 0% †
 jsonbench 
Cython2.142.1438,300323  0% 0% 0% 0% 0% 0% 100% 0%
Python 32.142.1513,136322  0% 2% 0% 1% 0% 1% 100% 1%
 regex-dna 
Cython0.040.04?524  0% 20% 0% 0% 100% 0% 0% 0%
Python 30.040.04?524  0% 0% 100% 0% 0% 0% 0% 0%
 templates 
Cython0.640.6616,780328  0% 0% 100% 0% 0% 0% 0% 1%
Python 30.630.6418,364322  4% 0% 0% 100% 0% 0% 0% 0%
 meteor-contest 
Cython2.352.3511,2281334  0% 0% 0% 0% 0% 0% 100% 0%
Python 32.092.109,5281443  1% 0% 0% 0% 0% 0% 0% 100%
 k-nucleotide 
Cython0.070.07?618  0% 0% 0% 100% 12% 0% 0% 0% †
Python 30.120.06?2011  17% 20% 20% 83% 33% 17% 20% 20% †
 fannkuch-redux 
No program
Python 35.430.7389,420894  88% 92% 93% 93% 95% 97% 93% 93%
 spectral-norm 
No program
Python 30.100.10?394  0% 92% 0% 0% 0% 0% 0% 0%
 fibonacci 
Cython0.500.509,412184  0% 100% 0% 0% 2% 0% 2% 0%
No program
 mandelbrot 
No program
Python 337.124.84294,1843852  96% 98% 96% 94% 94% 98% 97% 97%
 binary-trees 
No program
Python 31.520.2980,548741  67% 69% 66% 64% 63% 59% 67% 79%
 binary-trees-redux
   No programs

† possible mismatch - one-core program compared to multi-core program.

 4 : Are there other Cython programs for these benchmarks?

Remember - those are just the fastest Cython and Python 3 programs measured on this OS/machine. Check if there are other implementations of these benchmark programs for Cython.

Maybe one of those other Cython programs is fastest on a different OS/machine.

 5 : Are there other faster programs for these benchmarks?

Remember - those are just the fastest Cython and Python 3 programs measured on this OS/machine. Check if there are faster implementations of these benchmark programs for other programming languages.

Maybe one of those other programs is fastest on a different OS/machine.

 Cython : Python compiled to C 

Revised BSD license

  Home   Conclusions   License   Play