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 8,532 601 1.75 100% 1% 1% 0%
C gcc 1.73 2,116 448 1.73 1% 99% 1% 0%
fannkuch-redux
source secs mem gz cpu cpu load
Swift 10.20 9,784 1102 40.28 100% 99% 98% 98%
C gcc 8.97 1,660 910 35.00 98% 94% 99% 100%
fasta
source secs mem gz cpu cpu load
Swift 2.32 34,356 2096 7.62 76% 79% 83% 93%
C gcc 1.33 2,856 2249 5.28 100% 99% 100% 99%
spectral-norm
source secs mem gz cpu cpu load
Swift 3.98 11,292 601 15.82 100% 100% 100% 100%
C gcc 1.99 1,824 1139 7.88 99% 99% 99% 100%
mandelbrot
source secs mem gz cpu cpu load
Swift 3.32 41,748 1136 13.19 100% 99% 99% 99%
C gcc 1.65 32,684 1135 6.53 99% 99% 100% 99%
reverse-complement
source secs mem gz cpu cpu load
Swift 0.86 210,216 1287 1.03 79% 2% 1% 42%
C gcc 0.42 143,948 812 0.58 15% 26% 98% 2%
binary-trees
source secs mem gz cpu cpu load
Swift 4.96 192,596 997 13.89 60% 63% 61% 99%
C gcc 2.38 131,728 836 7.70 98% 87% 73% 68%
n-body
source secs mem gz cpu cpu load
Swift 21.96 7,396 1253 21.95 1% 100% 1% 0%
C gcc 9.96 1,016 1490 9.95 1% 1% 1% 100%
k-nucleotide
source secs mem gz cpu cpu load
Swift 20.73 246,548 1366 76.47 94% 94% 90% 92%
C gcc 5.38 129,772 1499 16.37 61% 82% 89% 74%
regex-redux
source secs mem gz cpu cpu load
Swift 75.47 882,900 715 141.92 90% 2% 1% 100%
C gcc 1.45 155,768 1230 4.03 61% 64% 56% 100%
Swift

Swift version 4.0 (swift-4.0-RELEASE)
Target: x86_64-unknown-linux-gnu

C gcc

gcc (Ubuntu 6.3.0-12ubuntu2) 6.3.0 20170406