The Computer Language
Benchmarks Game

Fortran Intel versus C gcc fastest programs

Back in April 2010, Russ Cox charitably suggested that only fannkuch-redux, fasta, k-nucleotide, mandlebrot, nbody, reverse-complement and spectral-norm were close to fair comparisons. As someone who implemented programming languages, his interest was "measuring the quality of the generated code when both compilers are presented with what amounts to the same program."

Differences in approach - to memory management, parallel programming, regex, arbitrary precision arithmetic, implementation technique - don't fit in that kind-of fair comparison — but we still have to deal with them.

These are only the fastest programs. There may be additional measurements for programs which seem more-like a fair comparison to you. Always look at the source code.

pidigits
source secs mem gz busy cpu load
Fortran Intel 1.74 3,876 981 1.76 0% 99% 1% 1%
C gcc 1.75 2,660 452 2.02 1% 100% 14% 1%
spectral-norm
source secs mem gz busy cpu load
Fortran Intel 1.98 1,736 638 7.90 99% 100% 99% 100%
C gcc 1.98 1,252 1139 7.88 99% 100% 99% 99%
n-body
source secs mem gz busy cpu load
Fortran Intel 8.28 8 1524 8.37 100% 0% 0% 1%
C gcc 7.49 8 1391 7.56 0% 0% 100% 1%
regex-redux
source secs mem gz busy cpu load
Fortran Intel 1.77 173,036 2225 4.91 59% 62% 59% 97%
C gcc 1.46 152,236 1397 3.43 43% 100% 45% 48%
fannkuch-redux
source secs mem gz busy cpu load
Fortran Intel 12.56 11,040 1158 50.16 100% 100% 100% 100%
C gcc 8.61 880 910 33.96 95% 100% 99% 100%
binary-trees
source secs mem gz busy cpu load
Fortran Intel 5.44 112,944 1148 15.82 66% 63% 72% 90%
C gcc 3.48 168,744 809 11.47 99% 74% 79% 79%
fasta
source secs mem gz busy cpu load
Fortran Intel 3.34 8 1351 3.41 1% 100% 1% 0%
C gcc 1.36 2,912 2268 5.42 99% 100% 99% 99%
reverse-complement
source secs mem gz busy cpu load
Fortran Intel 4.82 985,340 1019 4.86 100% 0% 0% 1%
C gcc 1.78 994,532 1438 4.02 42% 96% 46% 43%
mandelbrot
source secs mem gz busy cpu load
Fortran Intel 6.69 61,884 661 23.24 83% 82% 82% 100%
C gcc 1.65 26,204 1135 6.56 99% 100% 99% 99%
k-nucleotide
source secs mem gz busy cpu load
Fortran Intel 97.44 203,204 2238 98.41 97% 0% 0% 4%
C gcc 5.01 130,104 1506 16.41 84% 100% 84% 59%
Fortran Intel

Intel(R) Fortran Intel(R) 64 Compiler
for applications running on Intel(R) 64,
Version 19.0.5.281 Build 20190815
Copyright (C) 1985-2019 Intel Corporation. All rights reserved.
FOR NON-COMMERCIAL USE ONLY

C gcc

gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0