From: Per W. <pw...@ia...> - 2009-08-26 18:48:30
|
A #define expansion will not affect the execution time. Use of #define will be handled by the compiler during compile time. For the executable, it doesn't matter if you use a #define, or if you write the expansion directly into the source. It is almost impossible to discuss execution timings for different code expansions. It will depend on what compiler, what compiler options, what processor, what memory latency and bandwidth and how you combine the code with other code. If you want to, you can benchmark different constructs, but the applicability of such benchmarking will depend on how close your system is to the end-users, and remember that a close loop will be way faster than the same code run at random times because of the differences in cache coherency. /pwm On 25 Aug 2009, anoop sabir wrote: > Will the use of #define macros reduce the execution time? If yes, how? > > >From where can I have a comparative understanding of various code structure and function execution timings? |