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-redux †1/2 ±
 binary-trees±±±
 richards± ±
 fannkuch-redux± ±
 fasta †± 1/2
 k-nucleotide±?±
 chameneos-redux± ±
 reverse-complement †±?±
 jsonbench± ±
 pidigits±?±
 fibonacci± ±
 mandelbrot± ±
 regex-dna †±?±
 templates †± ±
 meteor-contest± ±
 Cython used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/2391/2391/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% 100% 0% 0% †
Python 35.495.508,472367  25% 23% 100% 18% †
 thread-ring 
Cython0.290.29844419  0% 7% 3% 100% †
Python 327.2421.6413,344448  31% 36% 27% 34% †
 fib50 
Cython0.770.788,748159  28% 9% 73% 1% †
Python 33.743.758,908136  37% 26% 33% 100% †
 n-body 
Cython11.9912.018,5001392  8% 11% 9% 100% †
Python 344.2944.338,7961315  7% 100% 3% 4% †
 pystone 
Cython0.090.10?2402  0% 100% 10% 0%
Python 30.260.271,8082303  7% 100% 4% 0%
 fasta-redux 
Cython0.170.17?1169  0% 25% 0% 100% †
Python 30.290.291,7761115  10% 3% 100% 3% †
 binary-trees 
Cython1.880.6860,940735  72% 75% 87% 69%
Python 33.270.9662,884706  88% 88% 85% 94%
 richards 
Cython0.800.808,4122467  2% 10% 4% 100%
Python 31.121.129,0682434  6% 100% 2% 0%
 fannkuch-redux 
Cython10.102.9252,9441027  92% 92% 86% 94%
Python 312.113.6652,808894  96% 93% 93% 95%
 fasta 
Cython4.024.178,584945  6% 86% 3% 18% †
Python 310.174.9090,4482016  70% 79% 66% 51% †
 k-nucleotide 
Cython0.100.11?618  27% 80% 27% 18%
Python 30.120.13?594  100% 8% 14% 8%
 chameneos-redux 
Cython151.7685.348,5441203  45% 50% 43% 40%
Python 3166.3596.308,8201191  51% 46% 41% 46%
 reverse-complement 
Cython0.020.02?449  100% 0% 0% 0% †
Python 30.020.02?449  0% 0% 100% 33% †
 jsonbench 
Cython3.503.6611,216323  4% 100% 5% 2%
Python 33.623.8012,268322  100% 5% 4% 5%
 pidigits 
Cython0.030.03?349  0% 0% 100% 0%
Python 30.030.03?379  0% 0% 100% 0%
 fibonacci 
Cython0.670.679,096184  4% 7% 100% 2%
Python 30.670.679,364182  5% 100% 6% 2%
 mandelbrot 
Cython79.3722.10183,0963832  99% 99% 98% 97%
Python 379.2821.88182,6763832  99% 96% 95% 98%
 regex-dna 
Cython0.050.05?524  29% 29% 0% 100% †
Python 30.050.05?524  0% 100% 0% 0% †
 templates 
Cython1.161.1819,924328  9% 13% 13% 100% †
Python 31.071.1119,692322  83% 26% 3% 6% †
 meteor-contest 
Cython3.693.8611,0161334  2% 100% 4% 2%
Python 33.403.468,8521443  44% 5% 64% 4%
 spectral-norm 
No program
Python 30.130.14?394  100% 0% 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