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/171 ±
 fib501/4 ±
 n-body †1/3 ±
 pystone1/3 ±
 thread-ring1/2 ±
 fasta-redux1/2 ±
 richards †1/2 ±
 binary-trees±±±
 k-nucleotide±?±
 fannkuch-redux± ±
 chameneos-redux± ±
 pidigits±?±
 fibonacci †± ±
 fasta †± 1/2
 reverse-complement±?±
 templates± ±
 jsonbench± ±
 mandelbrot± ±
 meteor-contest± ±
 regex-dna±?±
 Cython used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/1711/1711/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.030.03?366  0% 100% 0% 25% †
Python 34.604.619,164367  1% 1% 2% 100% †
 fib50 
Cython0.860.879,088156  100% 5% 3% 3%
Python 33.223.239,200136  1% 25% 1% 75%
 n-body 
Cython13.2013.228,7401392  14% 88% 25% 14% †
Python 344.4444.518,9161315  23% 1% 78% 1% †
 pystone 
Cython0.090.09?2402  10% 10% 0% 100%
Python 30.280.281,8362303  3% 7% 100% 0%
 thread-ring 
Cython0.290.291,944419  3% 3% 0% 100%
Python 30.570.579,104407  100% 0% 0% 0%
 fasta-redux 
Cython0.160.16?1169  100% 0% 0% 0%
Python 30.280.281,8401115  0% 7% 100% 3%
 richards 
Cython0.780.788,7282467  100% 6% 8% 8% †
Python 31.331.339,3722434  100% 1% 2% 1% †
 binary-trees 
Cython1.980.7668,652735  65% 69% 74% 84%
Python 33.761.1159,900706  95% 83% 84% 83%
 k-nucleotide 
Cython0.090.09?618  100% 0% 0% 0%
Python 30.110.12?594  100% 0% 0% 0%
 fannkuch-redux 
Cython10.612.8954,0721027  96% 95% 96% 95%
Python 312.623.2953,628894  99% 94% 98% 97%
 chameneos-redux 
Cython154.8285.528,8881203  43% 42% 42% 40%
Python 3159.9289.519,6001191  40% 41% 37% 44%
 pidigits 
Cython0.030.03?349  100% 0% 0% 0%
Python 30.030.03?379  100% 0% 0% 0%
 fibonacci 
Cython0.680.689,400184  1% 3% 1% 100% †
Python 30.680.689,656182  51% 69% 6% 7% †
 fasta 
Cython4.214.228,996945  2% 2% 100% 2% †
Python 38.794.2475,1322016  55% 63% 63% 32% †
 reverse-complement 
Cython0.020.03?449  0% 0% 0% 100%
Python 30.020.03?449  0% 0% 100% 0%
 templates 
Cython1.161.1621,148328  100% 0% 3% 0%
Python 31.161.1621,100322  1% 3% 100% 2%
 jsonbench 
Cython3.643.6512,736323  5% 100% 5% 5%
Python 33.613.6211,756322  2% 1% 2% 100%
 mandelbrot 
Cython72.3519.19190,9483832  99% 97% 97% 96%
Python 373.0218.99190,9083832  98% 100% 99% 98%
 meteor-contest 
Cython3.543.5411,0961334  37% 2% 64% 1%
Python 33.473.489,5601443  100% 2% 1% 1%
 regex-dna 
Cython0.050.05?524  0% 0% 100% 17%
Python 30.050.05?524  0% 100% 0% 0%
 spectral-norm 
No program
Python 30.130.13?394  0% 0% 7% 100%
 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