The Computer Language
Benchmarks Game

Swift programs versus C gcc

by benchmark task performance

pidigits
source secs mem gz cpu cpu load
Swift 1.75 7,396 601 1.74 1% 1% 100% 0%
C gcc 1.73 1,992 448 1.73 1% 100% 1% 0%
fannkuch-redux
source secs mem gz cpu cpu load
Swift 11.44 6,900 1102 45.27 100% 100% 98% 98%
C gcc 9.07 1,576 910 35.43 100% 99% 98% 94%
binary-trees
source secs mem gz cpu cpu load
Swift 5.55 247,508 1062 16.74 65% 74% 70% 95%
C gcc 3.28 156,780 906 10.12 91% 77% 59% 83%
fasta
source secs mem gz cpu cpu load
Swift 2.40 32,536 2096 7.26 78% 81% 72% 73%
C gcc 1.36 2,800 1993 5.26 96% 97% 100% 97%
mandelbrot
source secs mem gz cpu cpu load
Swift 3.22 40,340 1136 12.76 99% 99% 100% 99%
C gcc 1.64 29,848 1135 6.51 100% 100% 100% 100%
spectral-norm
source secs mem gz cpu cpu load
Swift 3.97 10,696 601 15.79 100% 100% 100% 100%
C gcc 1.98 1,776 1139 7.87 99% 99% 100% 99%
reverse-complement
source secs mem gz cpu cpu load
Swift 0.94 285,740 1287 1.12 54% 0% 47% 21%
C gcc 0.42 145,900 812 0.57 0% 26% 20% 100%
n-body
source secs mem gz cpu cpu load
Swift 23.59 4,336 1253 23.58 0% 100% 1% 0%
C gcc 9.56 1,000 1490 9.56 1% 100% 1% 1%
k-nucleotide
source secs mem gz cpu cpu load
Swift 20.48 263,288 1366 75.71 91% 99% 91% 91%
C gcc 6.46 130,076 1500 17.06 51% 37% 89% 88%
regex-redux
source secs mem gz cpu cpu load
Swift 97.48 694,832 671 97.43 1% 100% 0% 1%
C gcc 2.86 106,260 1266 4.47 19% 18% 100% 21%
Swift Swift version 3.1-dev (LLVM a7c680da51, Clang 9772bf511a, Swift 00b540bfbb)
Target: x86_64-unknown-linux-gnu
swift-3.1-DEVELOPMENT-SNAPSHOT-2017-03-13-a-ubuntu16.04
C gcc

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