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/239 ±
 thread-ring †1/75 ±
 fib50 †1/5 ±
 n-body †1/4 ±
 pystone1/3 ±
 fasta-redux1/2 ±
 richards1/2 ±
 jsonbench± ±
 k-nucleotide±?±
 templates± ±
 pidigits±?±
 reverse-complement±?±
 regex-dna±?±
 fibonacci †± ±
 meteor-contest †± ±
 chameneos-redux± ±
 Cython used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/2391/2391/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  100% 0% 0% 0% †
Python 35.495.508,472367  25% 23% 100% 18% †
 thread-ring 
Cython0.290.291,828419  100% 10% 7% 0% †
Python 327.2421.6413,344448  31% 36% 27% 34% †
 fib50 
Cython0.760.778,744159  100% 3% 4% 3% †
Python 33.743.758,908136  37% 26% 33% 100% †
 n-body 
Cython12.0012.048,5441392  50% 8% 9% 55% †
Python 344.2944.338,7961315  7% 100% 3% 4% †
 pystone 
Cython0.090.09?2402  0% 100% 0% 0%
Python 30.260.271,8082303  7% 100% 4% 0%
 fasta-redux 
Cython0.150.15?1169  0% 0% 100% 0%
Python 30.290.291,7761115  10% 3% 100% 3%
 richards 
Cython0.730.738,5402467  4% 100% 3% 3%
Python 31.121.129,0682434  6% 100% 2% 0%
 jsonbench 
Cython3.533.5412,416323  4% 100% 5% 3%
Python 33.623.8012,268322  100% 5% 4% 5%
 k-nucleotide 
Cython0.120.12?618  15% 58% 8% 100%
Python 30.120.13?594  100% 8% 14% 8%
 templates 
Cython1.071.0819,832328  3% 100% 3% 5%
Python 31.071.1119,692322  83% 26% 3% 6%
 pidigits 
Cython0.030.03?349  0% 100% 0% 0%
Python 30.030.03?379  0% 0% 100% 0%
 reverse-complement 
Cython0.020.02?449  33% 0% 100% 0%
Python 30.020.02?449  0% 0% 100% 33%
 regex-dna 
Cython0.050.05?524  0% 100% 0% 0%
Python 30.050.05?524  0% 100% 0% 0%
 fibonacci 
Cython0.680.709,068184  81% 24% 22% 40% †
Python 30.670.679,364182  5% 100% 6% 2% †
 meteor-contest 
Cython3.723.7311,1561334  100% 8% 9% 8% †
Python 33.403.468,8521443  44% 5% 64% 4% †
 chameneos-redux 
Cython211.41111.178,5121203  47% 43% 46% 46%
Python 3166.3596.308,8201191  51% 46% 41% 46%
 binary-trees 
No program
Python 33.280.9664,672706  90% 86% 90% 87%
 fasta 
No program
Python 39.474.5089,8002016  68% 59% 51% 68%
 spectral-norm 
No program
Python 30.130.14?394  100% 0% 0% 8%
 fannkuch-redux 
No program
Python 311.833.4652,828894  97% 96% 90% 97%
 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