The Computer Language
Benchmarks Game

Python 3 programs versus C gcc

by benchmark task performance

pidigits
source secs mem gz cpu cpu load
Python 3 3.43 12,716 386 3.43 100% 1% 1% 0%
C gcc 1.74 2,716 452 1.74 100% 1% 1% 2%
reverse-complement
source secs mem gz cpu cpu load
Python 3 3.26 264,596 814 4.67 18% 99% 1% 26%
C gcc 0.48 200,492 820 0.66 4% 19% 25% 98%
regex-redux
source secs mem gz cpu cpu load
Python 3 15.22 447,324 512 27.44 25% 33% 32% 91%
C gcc 1.48 152,352 1230 4.05 59% 99% 57% 61%
k-nucleotide
source secs mem gz cpu cpu load
Python 3 77.65 182,700 1967 302.86 97% 99% 97% 98%
C gcc 6.67 130,160 1506 19.33 76% 50% 92% 75%
binary-trees
source secs mem gz cpu cpu load
Python 3 93.55 280,624 589 337.74 92% 89% 87% 93%
C gcc 2.44 133,956 836 7.57 80% 65% 68% 100%
fasta
source secs mem gz cpu cpu load
Python 3 59.47 15,996 1947 138.97 55% 55% 63% 66%
C gcc 1.32 2,912 2268 5.25 100% 99% 100% 99%
fannkuch-redux
source secs mem gz cpu cpu load
Python 3 565.97 15,528 950 2,172.63 95% 94% 95% 100%
C gcc 8.66 980 910 34.22 100% 97% 100% 100%
spectral-norm
source secs mem gz cpu cpu load
Python 3 180.97 15,876 443 720.51 100% 100% 100% 100%
C gcc 2.00 1,300 569 7.89 99% 99% 100% 99%
n-body
source secs mem gz cpu cpu load
Python 3 838.39 10,324 1196 838.20 95% 1% 5% 0%
C gcc 9.12 1,176 1490 9.12 1% 100% 2% 2%
mandelbrot
source secs mem gz cpu cpu load
Python 3 225.24 15,736 688 899.25 100% 100% 100% 100%
C gcc 1.64 29,424 1135 6.53 99% 100% 100% 100%
Python 3

Python 3.6.3

C gcc

gcc (Ubuntu 7.2.0-8ubuntu3) 7.2.0