为什么在 XCode 中默认关闭循环?

Why is loop unrolling off by default in XCode?

似乎Apple LLVM 8.0 - Code Generation部分下的Unroll Loops优化设置在最新的XCode、8.2.1中默认关闭,即使对于Release配置也是如此.有什么好的理由吗?我认为循环展开是最基本的优化之一。

似乎禁用了以避免增加生成代码的大小。

Tuning for Performance and Responsiveness

Table 6-1 Compiler optimization options

Faster

The compiler performs nearly all supported optimizations that do not require a space-time tradeoff. The compiler does not perform loop unrolling or function inlining with this option. This option increases both compilation time and the performance of generated code.

Fastest

The compiler performs all optimizations in an attempt to improve the speed of the generated code. This option can increase the size of generated code as the compiler performs aggressive inlining of functions. This option is generally not recommended.