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.51 10,344 382 3.50 0% 2% 1% 100%
C gcc 1.73 2,116 448 1.73 1% 99% 1% 0%
reverse-complement
source secs mem gz cpu cpu load
Python 3 2.82 265,428 800 4.18 46% 32% 20% 54%
C gcc 0.42 143,948 812 0.58 15% 26% 98% 2%
regex-redux
source secs mem gz cpu cpu load
Python 3 14.86 439,208 486 27.92 46% 77% 35% 31%
C gcc 1.45 155,768 1230 4.03 61% 64% 56% 100%
k-nucleotide
source secs mem gz cpu cpu load
Python 3 84.73 221,028 1937 276.97 97% 93% 91% 91%
C gcc 5.38 129,772 1499 16.37 61% 82% 89% 74%
binary-trees
source secs mem gz cpu cpu load
Python 3 86.90 451,548 581 306.31 89% 97% 87% 89%
C gcc 2.38 131,728 836 7.70 98% 87% 73% 68%
fannkuch-redux
source secs mem gz cpu cpu load
Python 3 483.79 51,896 944 1,880.10 97% 94% 100% 99%
C gcc 8.97 1,660 910 35.00 98% 94% 99% 100%
n-body
source secs mem gz cpu cpu load
Python 3 787.02 7,744 1181 786.82 0% 1% 0% 100%
C gcc 9.96 1,016 1490 9.95 1% 1% 1% 100%
fasta
source secs mem gz cpu cpu load
Python 3 110.91 8,024 977 110.87 100% 1% 1% 1%
C gcc 1.33 2,856 2249 5.28 100% 99% 100% 99%
spectral-norm
source secs mem gz cpu cpu load
Python 3 188.83 54,524 437 750.46 99% 100% 100% 99%
C gcc 1.99 1,824 1139 7.88 99% 99% 99% 100%
mandelbrot
source secs mem gz cpu cpu load
Python 3 273.43 53,416 686 1,091.35 100% 100% 100% 100%
C gcc 1.65 32,684 1135 6.53 99% 99% 100% 99%
Python 3

Python 3.6.1 (default, Apr 18 2017, 10:33:41)
[GCC 6.3.0 20170406]
--enable-optimizations --with-lto
make profile-opt

C gcc

gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406