There is an option in CCS --opt_for_speed. Since it controls the code size and code running speed, setting it to 0 can minimize the code/slowest running speed, and setting it to 5 can achieve the fastest running speed/largest code. We can choose between 0-5 to make a trade-off. CCS provides a tool Optimizer Assistant that can compile and link all options 0-5 to find the best solution. We can open the tool through the menu View->Other->Code Composer Studio->Optimizer Assistant. After the tool is finished running, the green arrow indicates the current option, the green bar is the best option, and the red is the failed option. I think it is enough to know the above. If you want to learn more, the English original and translation are attached at the end of this article for reference. 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.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. 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. 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 failed 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.