The Computer Language
Benchmarks Game

Swift programs versus C gcc

by benchmark task performance

pidigits
source secs mem gz cpu cpu load
Swift 1.76 8,932 601 1.75 100% 2% 1% 2%
C gcc 1.74 2,716 452 1.74 100% 1% 1% 2%
fannkuch-redux
source secs mem gz cpu cpu load
Swift 10.08 7,920 1102 39.91 98% 100% 98% 100%
C gcc 8.66 980 910 34.22 100% 97% 100% 100%
fasta
source secs mem gz cpu cpu load
Swift 2.41 32,480 2096 8.07 78% 86% 90% 81%
C gcc 1.32 2,912 2268 5.25 100% 99% 100% 99%
spectral-norm
source secs mem gz cpu cpu load
Swift 3.97 9,684 601 15.81 100% 100% 100% 100%
C gcc 2.00 1,300 569 7.89 99% 99% 100% 99%
mandelbrot
source secs mem gz cpu cpu load
Swift 3.31 39,544 1136 13.09 99% 99% 100% 99%
C gcc 1.64 29,424 1135 6.53 99% 100% 100% 100%
binary-trees
source secs mem gz cpu cpu load
Swift 4.98 190,896 1001 14.01 61% 100% 63% 60%
C gcc 2.44 133,956 836 7.57 80% 65% 68% 100%
reverse-complement
source secs mem gz cpu cpu load
Swift 1.00 285,556 1287 1.18 80% 1% 36% 2%
C gcc 0.48 200,492 820 0.66 4% 19% 25% 98%
n-body
source secs mem gz cpu cpu load
Swift 21.96 7,452 1253 21.95 0% 1% 100% 0%
C gcc 9.12 1,176 1490 9.12 1% 100% 2% 2%
k-nucleotide
source secs mem gz cpu cpu load
Swift 20.55 193,992 1366 76.16 91% 97% 92% 91%
C gcc 6.67 130,160 1506 19.33 76% 50% 92% 75%
regex-redux
source secs mem gz cpu cpu load
Swift 74.22 898,456 715 137.84 2% 86% 100% 3%
C gcc 1.48 152,352 1230 4.05 59% 99% 57% 61%
Swift

Swift version 4.1-dev (LLVM 3fa7aed3df, Clang 529966cf07, Swift 607f23d66d)
Target: x86_64-unknown-linux-gnu

C gcc

gcc (Ubuntu 7.2.0-8ubuntu3) 7.2.0