[Monetdb-developers] * Re: Functions & macros

Stefan Manegold Stefan.Manegold at cwi.nl
Fri Nov 10 20:23:21 CET 2006


very quick and basic rule:

function call are only expensive if they are called very often (i.e. in inner
loops) and if the actual body of the function is very small/cheap.
in such cases avoiding function calls by using marco can improve
performance.
in (most) other cases, function call cost "vanish" behind other costs.

Stefan

On Fri, Nov 10, 2006 at 07:40:20PM +0100, Martin Kersten wrote:
> Wouter Scherphof wrote:
> > Let me just check if I got this correctly:
> > Is it a general rule that each call to a function generates overhead, 
> > that can be eliminated by replacing the function with a macro and 
> > "calling" the macro instead?
> 
> In general yes, but.... the exploded code may become more difficult
> to debug (using gdb), the code may become too large for compilers or
> cache, and you may run out of registers.
> 
> But, used with some care you can indeed improve performance significantly.
> 
> >  
> > Regards, Wouter.
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > -------------------------------------------------------------------------
> > Using Tomcat but need to do more? Need to support web services, security?
> > Get stuff done quickly with pre-integrated technology to make your job easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> > 
> > 
> > ------------------------------------------------------------------------
> > 
> > _______________________________________________
> > Monetdb-developers mailing list
> > Monetdb-developers at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/monetdb-developers
> 
> 
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Monetdb-developers mailing list
> Monetdb-developers at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/monetdb-developers
> 
> 

-- 
| Dr. Stefan Manegold | mailto:Stefan.Manegold at cwi.nl |
| CWI,  P.O.Box 94079 | http://www.cwi.nl/~manegold/  |
| 1090 GB Amsterdam   | Tel.: +31 (20) 592-4212       |
| The Netherlands     | Fax : +31 (20) 592-4312       |




More information about the developers-list mailing list