GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Concepts  >  OOPS
Go To First  |  Previous Question  |  Next Question 
 OOPS  |  Question 15 of 64    Print  
how macro execution is faster than function ?

  
Total Answers and Comments: 4 Last Update: May 15, 2007     Asked by: supriya 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: Anita
 
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.

Above answer was rated as good by the following members:
achintya
March 21, 2006 05:28:36   #1  
Parveen Siwach        

RE: how macro execution is faster than function ?
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 .
 
Is this answer useful? Yes | No
May 15, 2006 06:40:04   #2  
Anita        

RE: how macro execution is faster than function ?
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.
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
November 22, 2006 07:54:34   #3  
darshan.n        

RE: how macro execution is faster than function ?
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.
 
Is this answer useful? Yes | No
May 15, 2007 08:39:53   #4  
rajat        

RE: how macro execution is faster than function ?
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.
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape