Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!helios!stat!john From: john@stat.tamu.edu (John S. Price) Newsgroups: comp.lang.c Subject: Re: Return value from a macro Message-ID: <4172@helios.TAMU.EDU> Date: 3 Feb 90 09:33:06 GMT References: <1990Jan28.040427.22679@virtech.uucp> <282@isgtec.UUCP> Sender: usenet@helios.TAMU.EDU Reply-To: john@stat.tamu.edu (John S. Price) Distribution: usa Organization: Statistics Department, Texas A&M University Lines: 23 In article <282@isgtec.UUCP> robert@isgtec.UUCP (Robert Osborne) writes: >The important thing is to know when to use macros. Sometimes inline macros >can cut the execution time from 12 minutes to 2-3 (to use a actual example >from here). Often the performance gain is NOT slight. Using a macro >inside a critical loop that gets performed 500,000 times is not only "good" >it's a necessity. Writing a macro to replace fprintf is stupid. >-- >Robert A. Osborne {...uunet!mnetor,...utzoo}!lsuc!isgtec!robert I agree. Writing a macro that gets used in alot of different places can cause the size of the executable to grow. These types of macros should be relative small (I believe putc() is a good example). If you have a large macro, and it's used in one or two places, as in the loop example above, by all means use it, because, as it is mentioned above, the function call overhead does add up. Just my $.02 worth. -------------------------------------------------------------------------- John Price | It infuriates me to be wrong john@stat.tamu.edu | when I know I'm right.... --------------------------------------------------------------------------