Skip to content
Plorence edited this page Mar 11, 2020 · 1 revision

Optimization Level

Options Optimization Level Execution Time Code Size Memory Usage Compile Time
-O0 optimization for compilation time (default) + + - -
-O1(O) optimization for code size and execution time - - + +
-O2 optimization more for code size and execution time -- + ++
-O3 optimization more for code size and execution time --- + +++
-Os optimization for code size -- ++
-Ofast O3 with fast none accurate math calculations --- + +++

+increase ++increase more +++increase even more -reduce --reduce more ---reduce even more
Origin here, GCC online docs here

Clone this wiki locally