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/155 ±
 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± ±
 reverse-complement †±?±
 regex-dna±?±
 mandelbrot± ±
 fibonacci± ±
 pidigits±?±
 jsonbench± ±
 templates± ±
 fasta †± 1/2
 meteor-contest± ±
 Cython used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/1551/1551/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.573.578,728367  100% 0% 0% 0%
 fib50 
Cython0.800.809,144156  1% 1% 0% 100%
Python 33.243.249,352136  0% 69% 0% 32%
 n-body 
Cython12.8512.858,9321392  8% 54% 57% 8% †
Python 343.2343.238,8681315  0% 100% 0% 0% †
 pystone 
Cython0.090.09?2402  0% 10% 0% 100%
Python 30.290.291,9442303  0% 0% 0% 100%
 thread-ring 
Cython0.280.291,836419  0% 3% 3% 100%
Python 30.570.579,120407  0% 2% 0% 100%
 fasta-redux 
Cython0.150.15?1169  0% 6% 100% 0%
Python 30.280.281,7801115  0% 100% 3% 4%
 binary-trees 
Cython1.850.5560,892735  82% 80% 84% 93%
Python 33.471.0259,132741  83% 82% 83% 95%
 richards 
Cython0.760.768,8002467  0% 0% 99% 1%
Python 31.281.289,2762434  1% 0% 99% 0%
 k-nucleotide 
Cython0.090.09?618  0% 100% 10% 10%
Python 30.110.11?594  0% 100% 9% 0%
 fannkuch-redux 
Cython10.162.6952,7681027  93% 94% 94% 97%
Python 312.423.3153,996894  93% 91% 98% 93%
 chameneos-redux 
Cython114.6961.868,7681203  31% 37% 31% 38%
Python 3120.8065.948,8321191  36% 34% 35% 33%
 reverse-complement 
Cython0.020.02?449  0% 0% 0% 100% †
Python 30.020.03?449  33% 0% 100% 0% †
 regex-dna 
Cython0.050.05?524  0% 0% 0% 100%
Python 30.050.05?524  0% 0% 100% 0%
 mandelbrot 
Cython72.9118.51186,9643832  98% 98% 99% 100%
Python 373.5018.79187,1043832  99% 99% 97% 97%
 fibonacci 
Cython0.670.679,656184  0% 100% 0% 3%
Python 30.670.679,516182  1% 0% 99% 0%
 pidigits 
Cython0.030.03?349  0% 0% 100% 0%
Python 30.030.03?379  0% 0% 0% 100%
 jsonbench 
Cython3.623.6213,024323  0% 72% 0% 29%
Python 33.613.6112,148322  0% 1% 0% 100%
 templates 
Cython1.241.2421,220328  1% 69% 1% 32%
Python 31.241.2421,180322  0% 0% 1% 100%
 fasta 
Cython4.294.299,012945  100% 0% 0% 0% †
Python 39.234.2481,3362016  68% 90% 22% 40% †
 meteor-contest 
Cython3.683.6811,4201334  0% 0% 100% 0%
Python 33.443.449,2641443  0% 50% 0% 50%
 spectral-norm 
No program
Python 30.120.12?394  9% 82% 0% 8%
 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