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/161 ±
 fib501/3 ±
 thread-ring †1/3 ±
 n-body †1/2 ±
 richards1/2 ±
 binary-trees1/2±±
 pystone± ±
 mandelbrot± ±
 templates †± ±
 fasta-redux †± ±
 regex-dna±?±
 meteor-contest †± ±
 chameneos-redux± ±
 fibonacci± ±
 reverse-complement †±?±
 k-nucleotide±?±
 pidigits †±?±
 jsonbench± ±
 fannkuch-redux± ±
 fasta 1/2
 spectral-norm †18×?±
 Cython used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/1611/241/2±±18×

† 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% 50% 100% 67%
Python 35.485.498,808367  85% 9% 28% 100%
 fib50 
Cython1.341.358,764156  100% 5% 4% 2%
Python 34.144.159,260136  1% 100% 2% 1%
 thread-ring 
Cython0.370.371,616407  3% 3% 100% 0% †
Python 30.940.959,352407  15% 17% 22% 99% †
 n-body 
Cython33.5233.538,2841315  56% 7% 50% 6% †
Python 370.4270.449,0161315  43% 29% 62% 76% †
 richards 
Cython0.960.968,2842467  3% 100% 0% 4%
Python 31.651.659,2842434  50% 2% 54% 2%
 binary-trees 
Cython3.270.9865,912706  94% 83% 86% 84%
Python 35.281.4769,124741  93% 91% 88% 90%
 pystone 
Cython0.260.271,6122288  100% 7% 0% 0%
Python 30.390.391,8442303  10% 3% 100% 3%
 mandelbrot 
Cython101.0427.98184,1243832  99% 100% 99% 99%
Python 399.4733.25188,7043832  98% 100% 99% 97%
 templates 
Cython1.651.6515,552328  7% 7% 4% 100% †
Python 31.951.9522,628322  82% 23% 21% 44% †
 fasta-redux 
Cython0.370.381,6481115  100% 13% 3% 5% †
Python 30.390.391,8281115  3% 0% 100% 0% †
 regex-dna 
Cython0.060.06?524  86% 0% 14% 0%
Python 30.060.06?524  14% 0% 0% 88%
 meteor-contest 
Cython5.135.139,4481334  1% 100% 0% 3% †
Python 35.205.209,6281443  6% 7% 100% 100% †
 chameneos-redux 
Cython171.6094.138,2561203  39% 36% 48% 50%
Python 3170.3092.848,9561191  38% 41% 42% 38%
 fibonacci 
Cython0.840.849,312184  4% 100% 1% 1%
Python 30.790.809,636182  11% 3% 1% 100%
 reverse-complement 
Cython0.030.03?449  100% 50% 0% 0% †
Python 30.030.03?449  0% 67% 0% 0% †
 k-nucleotide 
Cython0.180.19?594  30% 22% 100% 21%
Python 30.170.17?594  12% 89% 100% 6%
 pidigits 
Cython0.030.04?379  0% 0% 50% 100% †
Python 30.030.04?379  0% 0% 0% 100% †
 jsonbench 
Cython6.756.7512,312323  29% 100% 27% 22%
Python 35.765.7812,956322  17% 91% 100% 22%
 fannkuch-redux 
Cython25.676.9953,7961271  96% 92% 98% 91%
Python 320.075.2855,292894  96% 95% 97% 97%
 fasta 
Cython13.3813.408,240904  16% 92% 16% 21%
Python 314.996.33421,5922016  68% 78% 49% 48%
 spectral-norm 
Cython9.752.6753,796575  95% 94% 96% 94% †
Python 30.140.15?394  7% 0% 100% 13% †
 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