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/221 ±
 thread-ring1/75 ±
 fib501/5 ±
 n-body1/4 ±
 fasta-redux1/2 ±
 richards †1/2 ±
 fasta †± 1/2
 templates± ±
 jsonbench± ±
 pidigits±?±
 chameneos-redux± ±
 reverse-complement±?±
 regex-dna±?±
 fibonacci †± ±
 meteor-contest± ±
 k-nucleotide †±?±
 Cython used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/2211/2211/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.03?366  100% 0% 0% 0%
Python 35.535.539,000367  5% 94% 0% 6%
 thread-ring 
Cython0.310.321,696419  97% 29% 0% 3%
Python 334.1324.1813,204448  23% 37% 20% 48%
 fib50 
Cython0.680.689,136159  4% 1% 100% 0%
Python 33.393.468,396136  43% 1% 59% 1%
 n-body 
Cython10.5010.599,0441392  22% 82% 0% 0%
Python 346.5346.908,8121315  21% 0% 83% 1%
 fasta-redux 
Cython0.130.13?1169  0% 100% 0% 0%
Python 30.270.271,7801115  11% 0% 0% 100%
 richards 
Cython0.630.638,7002467  21% 83% 2% 15% †
Python 31.091.109,0082434  5% 0% 0% 100% †
 fasta 
Cython3.183.338,944945  100% 1% 2% 8% †
Python 37.824.22104,0842016  50% 75% 56% 10% †
 templates 
Cython0.920.9216,340328  12% 100% 1% 0%
Python 31.031.0319,980322  8% 100% 1% 1%
 jsonbench 
Cython3.073.0812,844323  7% 100% 0% 2%
Python 33.293.2912,396322  5% 0% 1% 100%
 pidigits 
Cython0.030.03?349  0% 100% 0% 0%
Python 30.030.03?379  100% 0% 0% 0%
 chameneos-redux 
Cython338.88167.678,9561203  51% 44% 51% 48%
Python 3353.29175.808,9561191  48% 40% 47% 47%
 reverse-complement 
Cython0.020.02?449  0% 100% 0% 0%
Python 30.020.03?449  0% 100% 0% 0%
 regex-dna 
Cython0.050.05?524  0% 0% 14% 100%
Python 30.050.06?524  17% 100% 0% 0%
 fibonacci 
Cython0.670.719,420184  100% 24% 0% 0% †
Python 30.680.689,316182  6% 0% 100% 0% †
 meteor-contest 
Cython3.463.6211,3481334  100% 1% 0% 1%
Python 33.203.218,9201443  5% 100% 1% 1%
 k-nucleotide 
Cython0.090.09?618  11% 100% 0% 0% †
Python 30.090.07?801  14% 14% 14% 88% †
 fannkuch-redux 
No program
Python 313.173.4747,392894  97% 99% 91% 99%
 binary-trees 
No program
Python 33.200.9657,316741  89% 84% 81% 88%
 spectral-norm 
No program
Python 30.150.15?394  0% 0% 100% 0%
 mandelbrot
   No programs
 binary-trees-redux
   No programs
 pystone
   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