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/157 ±
 fib501/4 ±
 n-body †1/3 ±
 pystone1/3 ±
 thread-ring1/2 ±
 fasta-redux1/2 ±
 binary-trees1/2±±
 richards1/2 ±
 k-nucleotide±?±
 fannkuch-redux± ±
 chameneos-redux± ±
 pidigits±?±
 mandelbrot± ±
 reverse-complement±?±
 regex-dna±?±
 fibonacci± ±
 fasta †± 1/2
 jsonbench± ±
 meteor-contest± ±
 templates± ±
 Cython used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/1571/1571/2±±±±

† 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% 100% 0%
Python 33.603.618,808367  1% 0% 100% 0%
 fib50 
Cython0.800.809,144156  1% 1% 0% 100%
Python 33.303.309,148136  0% 100% 0% 0%
 n-body 
Cython12.8512.858,9321392  8% 54% 57% 8% †
Python 343.8943.898,7801315  11% 1% 89% 0% †
 pystone 
Cython0.090.09?2402  0% 10% 0% 100%
Python 30.290.291,8642303  0% 0% 3% 100%
 thread-ring 
Cython0.280.291,836419  0% 3% 3% 100%
Python 30.570.579,100407  0% 100% 0% 2%
 fasta-redux 
Cython0.150.15?1169  0% 6% 100% 0%
Python 30.280.281,9521115  100% 0% 3% 0%
 binary-trees 
Cython1.850.5560,892735  82% 80% 84% 93%
Python 33.461.0460,120741  96% 83% 82% 80%
 richards 
Cython0.760.768,8002467  0% 0% 99% 1%
Python 31.251.259,3722434  100% 0% 0% 0%
 k-nucleotide 
Cython0.090.09?618  0% 100% 10% 10%
Python 30.110.11?594  0% 100% 0% 0%
 fannkuch-redux 
Cython10.162.6952,7681027  93% 94% 94% 97%
Python 312.613.2955,084894  95% 96% 95% 98%
 chameneos-redux 
Cython114.6961.868,7681203  31% 37% 31% 38%
Python 3121.2567.529,0961191  35% 38% 36% 38%
 pidigits 
Cython0.030.03?349  0% 0% 100% 0%
Python 30.030.03?379  0% 0% 100% 0%
 mandelbrot 
Cython72.9118.51186,9643832  98% 98% 99% 100%
Python 373.3418.77189,1683832  99% 99% 97% 98%
 reverse-complement 
Cython0.020.02?449  0% 0% 0% 100%
Python 30.020.02?449  0% 0% 67% 0%
 regex-dna 
Cython0.050.05?524  0% 0% 0% 100%
Python 30.050.05?524  100% 0% 0% 0%
 fibonacci 
Cython0.670.679,656184  0% 100% 0% 3%
Python 30.670.679,756182  100% 0% 0% 1%
 fasta 
Cython4.294.299,012945  100% 0% 0% 0% †
Python 39.494.2993,1562016  78% 54% 46% 48% †
 jsonbench 
Cython3.623.6213,024323  0% 72% 0% 29%
Python 33.593.5912,456322  1% 100% 1% 0%
 meteor-contest 
Cython3.683.6811,4201334  0% 0% 100% 0%
Python 33.433.439,0521443  2% 100% 2% 1%
 templates 
Cython1.241.2421,220328  1% 69% 1% 32%
Python 31.151.1520,920322  100% 0% 0% 0%
 spectral-norm 
No program
Python 30.120.12?394  9% 83% 0% 0%
 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