To balance the tradeoff between code size and speed, use the --opt_for_speed option. The level of optimization (0-5) controls the type and degree of code size or code speed optimization:
Optimizes code size with a high risk of worsening or impacting performance.
Optimizes code size with a medium risk of worsening or impacting performance.
Optimizes code size with a low risk of worsening or impacting performance.
Optimizes code performance/speed with a low risk of worsening or impacting code size.
Optimizes code performance/speed with a medium risk of worsening or impacting code size.
Optimizes code performance/speed with a high risk of worsening or impacting code size.
If you specify the --opt_for_speed option without a parameter, the default setting is --opt_for_speed=4. If you do not specify the --opt_for_speed option, the default setting is 4
The older mechanism for controlling code space, the --opt_for_space option, has the following equivalences with the --opt_for_speed option:
--opt_for_space | --opt_for_speed |
---|---|
none | =4 |
=0 | =3 |
=1 | =2 |
=2 | =1 |
=3 | =0 |