3 ms·
Most compilers typically do a good job, but I was surprised to see such a difference on some examples. On those examples, Clang seems to be usually better than
by ronnix 16y ago
Most compilers typically do a good job, but I was surprised to see such a difference on some examples.
On those examples, Clang seems to be usually better than GCC at static code evaluation and local optimizations.
However, GCC beats Clang in examples 2 and 3 due to better loop optimization capabilities (such as unrolling), allowing it to use SSE instructions.
Example 3 show that the Intel compiler has even stronger unrolling and vectorization capabilities. Not unexpected, as their compiler has to be especially good at this in order to get good performance on the Itanium architecture (IA-64).
I'm also impressed by the trick used by ICC in example 7 (using a bittest against a statically computed bitmap to implement the comparisons).
It will be quite interesting to see the results the researchers will get on many more examples...