Python Interpreters Benchmarks
x64 ArchLinux : AMD® Ryzen 7 4700U®

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 Numba 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 Numba 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/257 ±
 n-body †1/5 ±
 fib50 †1/3 ±
 templates †1/3 ±
 Cython used what fraction? used how many times more? 
Time-used  |-  |---  25% median  75%  ---|  -|
(Elapsed secs)1/2571/2571/101/41/31/31/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 Numba program.

Program Source Code CPU secs Elapsed secs Memory KB Code B ≈ CPU Load
 iobench 
Cython0.020.02?366  0% 0% 0% 0% 0% 100% 0% 0% †
Numba4.864.88131,784400  37% 7% 7% 9% 61% 5% 16% 4% †
 n-body 
Cython8.338.338,9441392  0% 100% 0% 0% 1% 0% 0% 1% †
Numba42.5942.63148,1161347  30% 67% 10% 9% 37% 16% 10% 15% †
 fib50 
Cython0.530.548,752159  2% 0% 100% 4% 0% 2% 2% 4% †
Numba1.471.48119,832165  15% 14% 8% 4% 5% 13% 10% 99% †
 templates 
Cython0.640.6518,396328  2% 2% 2% 0% 3% 0% 100% 2% †
Numba1.621.64121,232344  24% 19% 99% 23% 24% 24% 26% 19% †
 reverse-complement 
Cython0.020.02?449  0% 0% 0% 0% 0% 0% 100% 0%
No program
 regex-dna 
Cython0.040.04?524  20% 0% 0% 0% 100% 0% 0% 0%
No program
 pystone 
Cython0.070.07?2401  12% 0% 88% 0% 0% 0% 0% 0%
No program
 pidigits 
Cython0.020.02?349  0% 0% 100% 0% 0% 33% 0% 0%
No program
 chameneos-redux 
Cython177.89271.0512,8881203  6% 3% 3% 3% 11% 10% 10% 11%
No program
 k-nucleotide 
Cython0.070.07?618  100% 22% 0% 0% 0% 0% 0% 0%
No program
 jsonbench 
Cython2.162.1613,212323  3% 0% 1% 0% 0% 1% 0% 100%
No program
 fibonacci 
No program
Numba1.571.59120,220164  38% 28% 31% 98% 41% 51% 31% 52%
 fasta-redux 
Cython0.110.12?1169  100% 0% 0% 0% 0% 0% 0% 0%
No program
 fasta 
Cython2.512.528,880945  4% 0% 0% 100% 0% 1% 0% 0%
No program
 richards 
Cython0.580.589,0722467  100% 2% 0% 0% 2% 0% 2% 0%
No program
 mandelbrot 
No program
Numba61.518.68133,9603886  94% 91% 96% 93% 93% 98% 92% 95%
 spectral-norm 
No program
Numba1.311.34131,484416  15% 9% 10% 8% 8% 9% 13% 99%
 meteor-contest 
Cython2.352.3511,1841334  100% 0% 0% 0% 2% 1% 0% 0%
No program
 thread-ring 
Cython0.230.233,120419  4% 0% 100% 0% 0% 0% 4% 4%
No program
 binary-trees 
No program
Numba357.8863.59154,632734  73% 70% 76% 94% 76% 74% 69% 75%
 fannkuch-redux
   No programs
 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 Numba 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 Numba 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