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,196 1397 2.03 48% 100% 54% 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.73 2,848 416 0.75 1% 100% 1% 0%
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 698,264 820 1.27 1% 18% 100% 28%
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.81 130,112 1506 12.18 54% 87% 79% 100%
binary-trees
source secs mem gz busy cpu load
Python 3 51.07 278,324 589 178.28 85% 86% 93% 85%
C gcc 1.79 168,760 809 5.35 64% 64% 71% 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.52 836 910 29.37 99% 100% 93% 99%
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,220 1463 0.79 1% 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,692 1135 5.08 100% 100% 100% 99%
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 740 1633 2.19 0% 0% 0% 100%
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 1,928 1197 1.57 100% 98% 100% 98%
Python 3

Python 3.9.2

C gcc

gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0