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.41 9,992 382 3.40 1% 2% 100% 1%
C gcc 1.73 1,992 448 1.73 1% 100% 1% 0%
regex-redux
source secs mem gz cpu cpu load
Python 3 14.87 433,868 486 28.02 32% 45% 84% 29%
C gcc 2.86 106,260 1266 4.47 19% 18% 100% 21%
reverse-complement
source secs mem gz cpu cpu load
Python 3 2.93 265,636 800 4.28 80% 46% 21% 2%
C gcc 0.42 145,900 812 0.57 0% 26% 20% 100%
k-nucleotide
source secs mem gz cpu cpu load
Python 3 72.35 229,040 1937 268.72 98% 94% 91% 94%
C gcc 6.46 130,076 1500 17.06 51% 37% 89% 88%
binary-trees
source secs mem gz cpu cpu load
Python 3 126.07 831,740 596 474.55 93% 93% 93% 99%
C gcc 3.28 156,780 906 10.12 91% 77% 59% 83%
fannkuch-redux
source secs mem gz cpu cpu load
Python 3 501.72 54,708 944 1,967.92 98% 97% 100% 99%
C gcc 9.07 1,576 910 35.43 100% 99% 98% 94%
fasta
source secs mem gz cpu cpu load
Python 3 113.03 7,860 977 112.99 1% 100% 0% 1%
C gcc 1.36 2,800 1993 5.26 96% 97% 100% 97%
n-body
source secs mem gz cpu cpu load
Python 3 836.27 7,756 1181 836.06 0% 1% 1% 100%
C gcc 9.56 1,000 1490 9.56 1% 100% 1% 1%
spectral-norm
source secs mem gz cpu cpu load
Python 3 180.01 55,892 437 714.86 99% 100% 99% 100%
C gcc 1.98 1,776 1139 7.87 99% 99% 100% 99%
mandelbrot
source secs mem gz cpu cpu load
Python 3 250.62 52,752 686 1,000.26 100% 100% 100% 100%
C gcc 1.64 29,848 1135 6.51 100% 100% 100% 100%
Python 3

Python 3.6.0 (default, Feb 5 2017, 10:29:14) [GCC 5.4.0 20160609] on linux
--enable-optimizations
make profile-opt

C gcc

gcc (Ubuntu 5.4.0-6ubuntu1~16.04.1) 5.4.0 20160609