time performance -global or local
-
MCU program, no cache, can anybody explain the performance comparison between global and local variables?
-
Your question is far from clear; does it have anything to do with C/C++/MFC?
Veni, vidi, abiit domum
-
Your question is far from clear; does it have anything to do with C/C++/MFC?
Veni, vidi, abiit domum
-
as I understand, local in stack, and possibly replaced by register. but local variable needs push/pop operation. Globals in RAM, no need to allocate memory/retrieve memory every time
-
MCU program, no cache, can anybody explain the performance comparison between global and local variables?
It depends on the architecture and how quickly the processor can form an address in comparison to how fast an instruction gets through the pipeline. The only way you're going to know for sure is to measure the speed of your app using both types of variables.
-
It depends on the architecture and how quickly the processor can form an address in comparison to how fast an instruction gets through the pipeline. The only way you're going to know for sure is to measure the speed of your app using both types of variables.