The option --opt_for_speed controls the tradeoff(权衡) between size and speed(0-5 range). Setting --opt_for_speed=0 enables optimizations geared towards(朝...调整) improving code size with a high risk of worsening or impacting(压缩) perforamnce.At the other extreme, setting --opt_for_speed=t enables optimization geared towards improving the code performance/speed with a hihg risk of worsening or impacting code size.Setting between 0 and 5 vary(变化) the emphasis on performance(对抗) code size.选项--opt_for_speed用于在代码和运行速度之间取一个权衡,其范围在0-5之间。设置--opt_for_speed为0则可以使优化有利于控制代码大小,而丧失代码性能。另一个极端是将--opt_for_speed设置为5,则有利于提升代码性能和速度,而使得代码尺寸会相应增大。将这个参数设为0-5之间,可以在这两点之间做一个很好的权衡。
Use the Optimizer Assistant feature to build your project for all setttings of --opt_for_speed. You can either double click on the Advice View entry, or select menu View->Other->Code Composer Studio->Optimizer Assisatan.使用优化助手可以对--opt_for_speed选项的所有设置进行全编译,我们可以通过以下菜单打开,View->Other->Code Composer Studio->Optimizer Assisatan。
You will see below.你将看到下图。
Select "speed vs. size trade-offs"(or you can select to vary by optimization level), and CCS will build your project with all settings for selected option to vary. The results window will update during the build run.
Final results will show a bar chart of code size for each --opt_for_speed setting. Any builds that faild link will show in red. In below results window, the green check mark represents current setting --opt_for_speed, and the green is recommended setting.