Performance Impact of Swift Compiler - optimization level

It should be fine. -Osize still runs most of the optimizations that -O does (in particular, it runs all of the passes that prevent the worst performance hazards of -Onone). The main easily observable difference is that the inliner is less aggressive, which will occasionally prevent the compiler from finding further optimization opportunities, but is usually pretty innocuous.

You may notice that I'm being a little bit hand-wavy about all of this; that's because the exact impact depends quite a bit on what exactly you're doing. But for "normal" apps, my rough expectation is that -Osize will have little to no performance impact (it actually improves performance sometimes). As always, the best advice is to measure the performance before and after, and report bugs for any cases where there are large regressions.

9 Likes