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,244 1397 2.02 48% 53% 100% 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,844 416 0.78 0% 100% 6% 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.87 694,780 820 1.36 18% 99% 12% 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.71 130,048 1506 12.15 100% 90% 82% 55%
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.78 168,764 809 5.23 63% 69% 100% 62%
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,900 2268 3.28 100% 99% 100% 100%
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.53 892 910 29.41 99% 98% 100% 93%
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,480 1135 5.08 100% 99% 100% 100%
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 100% 0% 0% 0%
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,216 569 2.85 99% 100% 100% 99%
Python 3

Python 3.9.0

C gcc

gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0