The Computer Language
Benchmarks Game

Python 3 versus C gcc fastest programs

Always look at the source code.

These are only the fastest programs. Look at the other programs. They may seem more-like a fair comparison to you.

pidigits
source secs mem gz busy cpu load
Python 3 2.38 12,120 567 2.44 0% 3% 1% 98%
C gcc 1.75 2,804 452 1.77 0% 100% 0% 1%
regex-redux
source secs mem gz busy cpu load
Python 3 2.12 111,692 1403 4.20 35% 41% 88% 34%
C gcc 1.47 152,156 1397 3.46 47% 100% 43% 45%
reverse-complement
source secs mem gz busy cpu load
Python 3 16.93 1,777,852 434 17.58 78% 21% 4% 0%
C gcc 1.91 532,932 820 2.59 21% 16% 99% 0%
k-nucleotide
source secs mem gz busy cpu load
Python 3 72.24 199,856 1967 275.38 94% 94% 96% 96%
C gcc 5.09 130,092 1506 16.69 100% 86% 60% 82%
binary-trees
source secs mem gz busy cpu load
Python 3 80.30 448,004 589 286.50 95% 87% 87% 88%
C gcc 3.53 168,764 809 11.64 74% 99% 72% 85%
fasta
source secs mem gz busy cpu load
Python 3 63.55 844,180 1947 129.71 40% 71% 33% 61%
C gcc 1.46 2,976 2268 5.82 99% 100% 99% 99%
fannkuch-redux
source secs mem gz busy cpu load
Python 3 534.40 47,236 950 2,104.05 99% 97% 99% 99%
C gcc 8.74 936 910 34.47 100% 95% 100% 100%
spectral-norm
source secs mem gz busy cpu load
Python 3 169.87 49,188 417 675.02 100% 99% 99% 99%
C gcc 1.98 1,236 569 7.87 99% 99% 99% 99%
n-body
source secs mem gz busy cpu load
Python 3 865.18 8,176 1196 874.96 2% 20% 79% 0%
C gcc 7.30 8 1391 7.33 0% 0% 1% 100%
mandelbrot
source secs mem gz busy cpu load
Python 3 259.50 48,192 688 1,036.70 100% 100% 100% 100%
C gcc 1.64 27,016 1135 6.54 100% 99% 100% 100%
Python 3

Python 3.8.0

C gcc

gcc (Ubuntu 9.2.1-9ubuntu2) 9.2.1 20191008