I stumbled across the Benchmark Game (code page) and compared Fortran and C. I was very surprised about the difference in the calculation time on the Mandelbrot test (Fortran is 4.3 times slower!) because both languages have very similar feature sets. Moreover, Fortran should be able to optimize more radical (see e.g. "Is Fortran easier to optimize than C for heavy calculations?").
Can one explain which feature is missing in Fortran which would be needed to gain a speed such as in the C example? (It seems that the bit-operations here are boosting the code.)
EDIT: It is not a question on which programing language is better (there are always many aspects which play a role). It is rather a fundamental question on the difference of optimization in this example.
Add-on to the answer by Peter Cordes: There is a paper on Basics of Vectorization for Fortran Applications which also shortly discusses SIMD in Fortran programming. For Intel compilers: Explicit Vector Programming in Fortran
foo(float *restrict outarray, float *restrict inarray){ ... }to promise the compiler that input/output arrays don't overlap, allowing it to auto-vectorize. But if you write your C correctly usingrestrict, C compilers can optimize, too. If you found one specific benchmark where FORTRAN is slower, then post the details here instead of linking to them. What's the inner loop, and which compilers + options, and which hardware? What asm did the compilers make? - Peter Cordes