2 ms·
My nerd snipe for the morning: "A High-Level Language Benchmark", p. 180, comparison of the results on p.194 with a few random compilers on the system I'm using
by jasomill 3y ago
My nerd snipe for the morning: "A High-Level Language Benchmark", p. 180, comparison of the results on p.194 with a few random compilers on the system I'm using today.
All results from my 2013 Mac Pro (12 core), compiled with -O3, "total size" binaries stripped, execution times averaged over 100 runs.
Changes to BYTE C source: add return type / value to main.
Changes to BYTE Fortran source: fix lower bounds on DO loops (FLAGS(0) is invalid), change LOGICAL comparison from .EQ. to .EQV. to silence compiler warning, change WRITE channel to stdout.
clang (Xcode 14.2)
Compiled Bytes: 1,096
Total Bytes: 49,496
Compile and Load: 0.392 s
Execute: 0.210 s
Ratio to PL/I-80: 0.015
1/(Ratio to PL/I-80): 66.67
gcc 12.2 (MacPorts)
Compiled Bytes: 1,224
Total Bytes: 49,496
Compile and Load: 0.247 s
Execute: 0.203 s
Ratio to PL/I-80: 0.0145
1/(Ratio to PL/I-80): 68.97
icc 2021.9.0 20230302
Compiled Bytes: 1,582
Total Bytes: 99,664
Compile and Load: 0.675 s
Execute: 0.334 s
Ratio to PL/I-80: 0.0239
1/(Ratio to PL/I-80): 41.92
gfortran 12.2 (MacPorts)
Compiled Bytes: 1,968
Total Bytes: 49,832
Compile and Load: 0.239 s
Execute: 0.00832 s
Ratio to PL/I-80: 0.000594
1/(Ratio to PL/I-80): 1,682.69
ifort 2021.9.0 20230302
Compiled Bytes: 2,467
Total Bytes: 801,192
Compile and Load: 0.617 s
Execute: 0.00667 s
Ratio to PL/I-80: 0.000476
1/(Ratio to PL/I-80): 2,098.95
Tentative conclusion: At least on x64 macOS, we should all be writing Fortran 77, compiled with GNU Fortran where code (esp. runtime) size is critical, Intel Fortran otherwise.
YMMV.