How macro execution is faster than function ?

Showing Answers 1 - 4 of 4 Answers

Parveen Siwach

  • Mar 21st, 2006
 

Macro execution is faster than function execution because in function, much of time is used to take control from function call to called function and much of time is spent in this process. Whereas in macro expression are directly replaced in the source code.Much of time is spent in the binding of the function to the caller function.It is first time when i m reply any question .

Anita

  • May 15th, 2006
 

When a function is executed, the control goes out of the program where the function is called. after the function execution is completed, the control again comes back to the program. In macro, while compiling the definition of the macro gets expanded in the place where macro is called, internally. So execution is faster. The control will always be in the program itself.

darshan.n

  • Nov 22nd, 2006
 

quite simple anology is it depends on which logic ur implementing ......if the call is with in the loop then the function call is feasible as writing maro there would increase the code size enormously ....but fuction call takes stak operation which takes longer time for exection campared to macro ....hence macro is faster but is not prefered always.

  Was this answer useful?  Yes

rajat

  • May 15th, 2007
 

Actually macro is faster than a function as the previous one does not go for scanning and validation like a real function, so the time is saved during these processes which makes macro faster.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions