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.

regex-redux
source secs mem gz busy cpu load
Python 3 1.36 112,052 1403 2.64 40% 88% 32% 33%
C gcc 0.80 152,196 1397 2.03 48% 100% 54% 53%
pidigits
source secs mem gz busy cpu load
Python 3 1.28 12,336 567 1.30 1% 0% 1% 100%
C gcc 0.73 2,848 416 0.75 1% 100% 1% 0%
reverse-complement
source secs mem gz busy cpu load
Python 3 7.16 1,005,968 814 10.65 20% 53% 47% 29%
C gcc 0.86 698,264 820 1.27 1% 18% 100% 28%
k-nucleotide
source secs mem gz busy cpu load
Python 3 46.37 239,472 1967 176.69 94% 95% 98% 94%
C gcc 3.81 130,112 1506 12.18 54% 87% 79% 100%
binary-trees
source secs mem gz busy cpu load
Python 3 49.35 278,628 589 174.26 95% 86% 86% 86%
C gcc 1.79 168,760 809 5.35 64% 64% 71% 100%
fasta
source secs mem gz busy cpu load
Python 3 39.10 846,628 1947 70.52 43% 8% 61% 69%
C gcc 0.82 2,896 2268 3.26 99% 100% 100% 99%
fannkuch-redux
source secs mem gz busy cpu load
Python 3 367.49 12,288 950 1,454.68 100% 98% 99% 98%
C gcc 7.52 836 910 29.37 99% 100% 93% 99%
mandelbrot
source secs mem gz busy cpu load
Python 3 172.58 12,216 688 689.62 100% 100% 100% 100%
C gcc 1.27 31,692 1135 5.08 100% 100% 100% 99%
n-body
source secs mem gz busy cpu load
Python 3 586.17 8,012 1196 589.84 0% 0% 0% 100%
C gcc 4.30 8 1391 4.32 0% 0% 0% 100%
spectral-norm
source secs mem gz busy cpu load
Python 3 118.40 22,912 407 470.86 99% 99% 99% 100%
C gcc 0.72 1,100 569 2.86 100% 99% 100% 100%
Python 3

Python 3.9.0

C gcc

gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0