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/255 ±
 thread-ring †1/85 ±
 n-body †1/5 ±
 fib501/4 ±
 pystone1/3 ±
 fasta-redux1/2 ±
 richards1/2 ±
 pidigits †1/2?±
 k-nucleotide±?±
 chameneos-redux± ±
 fasta †± 1/2
 templates± ±
 jsonbench± ±
 fibonacci †± ±
 reverse-complement †±?±
 regex-dna±?±
 meteor-contest± ±
 Cython used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/2551/2551/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 36.126.128,408367  1% 6% 1% 100%
 thread-ring 
Cython0.280.281,808419  4% 100% 0% 3% †
Python 332.3823.8413,176448  33% 38% 32% 29% †
 n-body 
Cython10.0110.028,4201392  2% 100% 1% 2% †
Python 344.7145.218,8281315  37% 30% 44% 11% †
 fib50 
Cython0.810.818,908159  0% 72% 0% 29%
Python 33.433.558,384136  1% 76% 2% 26%
 pystone 
Cython0.090.09?2402  0% 0% 0% 100%
Python 30.280.291,9402303  3% 4% 3% 97%
 fasta-redux 
Cython0.150.15?1169  6% 100% 0% 0%
Python 30.290.291,8881115  3% 4% 0% 97%
 richards 
Cython0.720.738,7482467  4% 100% 1% 1%
Python 31.151.158,9322434  2% 10% 100% 3%
 pidigits 
Cython0.030.03?349  100% 0% 0% 0% †
Python 30.040.05?379  60% 100% 80% 67% †
 k-nucleotide 
Cython0.090.09?618  100% 0% 0% 0%
Python 30.130.13?594  0% 8% 0% 100%
 chameneos-redux 
Cython283.69139.268,5241203  46% 46% 48% 47%
Python 3331.68177.208,8881191  49% 54% 48% 51%
 fasta 
Cython3.983.988,488945  100% 1% 2% 2% †
Python 38.994.4596,8682016  56% 55% 52% 47% †
 templates 
Cython1.051.0619,920328  2% 100% 3% 3%
Python 31.131.1320,156322  1% 11% 100% 1%
 jsonbench 
Cython3.403.4011,400323  1% 1% 100% 1%
Python 33.553.5612,296322  1% 7% 3% 100%
 fibonacci 
Cython0.670.689,252184  11% 100% 7% 12% †
Python 30.670.689,136182  100% 9% 3% 3% †
 reverse-complement 
Cython0.020.02?449  0% 0% 0% 67% †
Python 30.020.02?449  100% 0% 0% 33% †
 regex-dna 
Cython0.050.05?524  83% 0% 0% 0%
Python 30.050.05?524  0% 17% 100% 0%
 meteor-contest 
Cython3.553.5511,1241334  1% 1% 1% 100%
Python 33.353.358,8401443  81% 6% 20% 1%
 binary-trees 
No program
Python 33.351.0666,428741  84% 85% 78% 81%
 spectral-norm 
No program
Python 30.170.17?394  94% 6% 6% 0%
 fannkuch-redux 
No program
Python 312.963.4653,456894  98% 97% 98% 90%
 mandelbrot 
No program
Python 378.4320.47196,0883832  98% 99% 99% 97%
 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