常见问答

FAQ

How to perform code optimization of the ARM compiler on Keil μVision 5?  Issue Date:2019-10-01

Introduction:

Performing code optimization can reduce code size and improve performance. Generally, it will be trade-off between reducing code size and improving performance.

1. During development phase

To prevent the assembly code changed by the compiler, do not enable any optimization function during the development phase.

2. After program is developed and function is verified

Enable the optimization function for reducing the code size and improving the performance.

Scenario:

1. Verify the program without any optimization.

2. Reduce the code size and improve the performance.

 

Optimization Goal Table:

Optimization goal Useful optimization levels
Smaller code size -Oz
Faster performance -O2, -O3, -Ofast, -Omax
Better debug experience -O1
Better correlation between source code and generated code  -O0
Faster compile and build time -O0
Balanced code size reduction and fast performance -Os

Use Keil μVision 5 as an example to demonstrate how to perform the optimization:

1. Option window -> Target, then select ARM Compiler: V6.12

268-1

2. Option window -> C/C++ (AC6), then select Optimization option.

268-2

3. Click “Rebuild”.

268-3

Products:
Applications:
Function: Software and Tools,Development-Environment,Keil
本网站使用cookie作为与网站互动时识别浏览器之用,浏览本网站即表示您同意本网站对cookie的使用及相关隐私权政策