2017-05-08 01:20 AM
Good afternoon,sir:
Could you tell me how to solve the question about the code execution speed became slower and slower?
When I adjusted the circuit board which the CPU is
http://www.kynix.com/uploadfiles/pdf65976/STM32F103C4T6A.pdf
,I found that the executing speed of code became slower and slower.The specific performance is :In the beginning,all configurations and function modules are initializing,they are finishing just in few seconds.
With the increasing of adjusting time,the above executing time also increasing gradually.Up to now,it need about 90 seconds to finish which is unacceptable !
Does the memory leak then it lead to the code execution speed slower and slower ? Or has any reasons occurred here?
Please give me some suggestions ! Thank you a lot !
2017-05-08 03:47 AM
When you give a comparative judgement like 'faster'/'slower', it is very useful to show WHAT you measured, and HOW.
Otherwise it's impossible for others to reproduce or judge your results, or give any recommendation.
2017-05-08 03:51 AM
With so little details shared, it maybe challenging to give advice... Is the code bare metal, using rtos? What are the interrupt sources used in the aplication? How is the mcu clock frequency coming from? Usually there is no dynanic memory management in bare metal apps. Reduction of performance usually means sysclock frequency changed, low power modes, or some interrupts are not cleared properly and will slow down processing.
2017-05-08 04:06 AM
Suggest you profile your code so you understand where the time is being spent.
Do you use bubblesorts? Do you use high frequency interrupts?