cancel
Showing results for 
Search instead for 
Did you mean: 

Performance Optimization of software

Vvine
Associate II

I am using STM32F070 controller. Currently, I am in need of improving performance of the software. I tried to do some measures such as optimization of my code itself and raising the optimization level of compiler to -Ofast. However, I need to gain more performance but currently finding no way to do it further more.

Can anybody suggest me what could I try to gain some performance?

I am using Atollic studio 9.2 for my development. I am running processor at 20Mhz. I can not increase clock beyong this. I am running all code from flash. The vector table is also in Flash.

Will moving some code into RAM bring any benefit in speed, considering that I have 0 wait states on Flash?

Appreciate any suggestion on this topic. Thanks.

1 REPLY 1

Sounds like you need to focus on algorithmic improvements.

Look at loops and areas where the code spends most of its time. Profile if you aren't aware of where the choke points are currently.

See if you can unwrap loops, or move code out of loops the compiler might not recognize.

Use 32-bit values for general math, avoid using uint8_t or uint16_t for loop variables, for example.

Identify code which could be refactored base on your knowledge of the algorithm or range of numbers/math etc.

Identify code with heavy use of division or modulus operations.

Identify code which could be rewritten in assembler.

Identify things which can be done concurrently.

Decimate interrupt loading.

Avoid bloated code and libraries.

Avoid code using floating point math unnecessarily.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..