The Computer Language
Benchmarks Game

Python 3 versus C gcc fastest programs

Always look at the source code.

These are only the fastest programs. Do some of them use manually vectorized SIMD? 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 111,852 1403 2.64 32% 40% 33% 88%
C gcc 0.80 152,172 1397 2.01 52% 99% 48% 53%
pidigits
source secs mem gz busy cpu load
Python 3 1.28 12,024 567 1.29 0% 1% 100% 0%
C gcc 0.59 2,444 1090 2.37 100% 100% 100% 98%
reverse-complement
source secs mem gz busy cpu load
Python 3 7.20 1,005,184 814 10.75 20% 53% 48% 29%
C gcc 0.86 712,208 820 1.27 99% 28% 1% 19%
k-nucleotide
source secs mem gz busy cpu load
Python 3 46.28 241,108 1967 176.42 94% 97% 95% 96%
C gcc 3.72 130,260 1506 12.07 100% 89% 78% 57%
binary-trees
source secs mem gz busy cpu load
Python 3 48.03 462,732 472 174.44 89% 97% 88% 89%
C gcc 1.54 168,832 809 4.35 60% 67% 57% 100%
fannkuch-redux
source secs mem gz busy cpu load
Python 3 352.29 12,232 950 1,392.10 97% 99% 100% 99%
C gcc 7.58 872 910 29.61 100% 98% 99% 93%
fasta
source secs mem gz busy cpu load
Python 3 37.32 846,264 1947 71.03 10% 67% 83% 30%
C gcc 0.78 1,156 1463 0.78 0% 0% 0% 100%
mandelbrot
source secs mem gz busy cpu load
Python 3 163.32 12,080 688 642.00 98% 98% 98% 98%
C gcc 1.27 31,792 1135 5.08 100% 100% 99% 100%
n-body
source secs mem gz busy cpu load
Python 3 567.56 8,076 1196 570.95 0% 0% 0% 100%
C gcc 2.18 768 1633 2.19 0% 100% 0% 0%
spectral-norm
source secs mem gz busy cpu load
Python 3 120.99 13,424 407 479.86 99% 99% 99% 99%
C gcc 0.40 872 1197 1.58 100% 100% 100% 98%
Python 3

Python 3.9.2

C gcc

gcc (Ubuntu 10.3.0-1ubuntu1) 10.3.0