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
 iobench †1/229 ±
 thread-ring †1/77 ±
 fib50 †1/5 ±
 n-body1/4 ±
 pystone1/3 ±
 fasta-redux1/2 ±
 richards1/2 ±
 k-nucleotide †±?±
 fasta †± 1/2
 jsonbench± ±
 templates± ±
 fibonacci †± ±
 meteor-contest± ±
 reverse-complement †±?±
 pidigits±?±
 regex-dna±?±
 chameneos-redux± ±
 Cython used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/2291/2291/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% 100% †
Python 35.495.508,472367  25% 23% 100% 18% †
 thread-ring 
Cython0.280.281,808419  4% 100% 0% 3% †
Python 327.2421.6413,344448  31% 36% 27% 34% †
 fib50 
Cython0.810.818,908159  0% 72% 0% 29% †
Python 33.743.758,908136  37% 26% 33% 100% †
 n-body 
Cython10.0110.028,4201392  2% 100% 1% 2%
Python 344.2944.338,7961315  7% 100% 3% 4%
 pystone 
Cython0.090.09?2402  0% 0% 0% 100%
Python 30.260.271,8082303  7% 100% 4% 0%
 fasta-redux 
Cython0.150.15?1169  6% 100% 0% 0%
Python 30.290.291,7761115  10% 3% 100% 3%
 richards 
Cython0.720.738,7482467  4% 100% 1% 1%
Python 31.121.129,0682434  6% 100% 2% 0%
 k-nucleotide 
Cython0.090.09?618  100% 0% 0% 0% †
Python 30.120.13?594  100% 8% 14% 8% †
 fasta 
Cython3.983.988,488945  100% 1% 2% 2% †
Python 310.174.9090,4482016  70% 79% 66% 51% †
 jsonbench 
Cython3.403.4011,400323  1% 1% 100% 1%
Python 33.623.8012,268322  100% 5% 4% 5%
 templates 
Cython1.051.0619,920328  2% 100% 3% 3%
Python 31.071.1119,692322  83% 26% 3% 6%
 fibonacci 
Cython0.670.689,252184  11% 100% 7% 12% †
Python 30.670.679,364182  5% 100% 6% 2% †
 meteor-contest 
Cython3.553.5511,1241334  1% 1% 1% 100%
Python 33.403.468,8521443  44% 5% 64% 4%
 reverse-complement 
Cython0.020.02?449  0% 0% 0% 67% †
Python 30.020.02?449  0% 0% 100% 33% †
 pidigits 
Cython0.030.03?349  100% 0% 0% 0%
Python 30.030.03?379  0% 0% 100% 0%
 regex-dna 
Cython0.050.05?524  83% 0% 0% 0%
Python 30.050.05?524  0% 100% 0% 0%
 chameneos-redux 
Cython283.69139.268,5241203  46% 46% 48% 47%
Python 3166.3596.308,8201191  51% 46% 41% 46%
 fannkuch-redux 
No program
Python 311.833.4652,828894  97% 96% 90% 97%
 spectral-norm 
No program
Python 30.130.14?394  100% 0% 0% 8%
 binary-trees 
No program
Python 33.280.9664,672706  90% 86% 90% 87%
 mandelbrot 
No program
Python 374.0819.52181,9363832  98% 98% 98% 99%
 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