This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Understanding Macro Pre-processor
- From: "Bruno Moreira Guedes" <thbmatrix at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Fri, 21 Sep 2007 13:11:35 -0300
- Subject: Re: Understanding Macro Pre-processor
- References: <3fdd6ce00709201243u576ec2d6u4d2224ddeca5cc0d@mail.gmail.com> <01f201c7fc4b$18b59a90$2e08a8c0@CAM.ARTIMI.COM>
2007/9/21, Dave Korn <dave.korn@artimi.com>:
> On 20 September 2007 20:44, Bruno Moreira Guedes wrote:
>
> > Bu I've been made some tests... By example... A macro:
> >
> > #define mul(X,Y) (X*Y)
> >
> >
> > It makes the processing faster...
>
> Your test methodology is broken.
>
> > But... Why executing that a milion of times is faster than using the
> > simple a*b itself???
>
> It isn't.
>
> > It really happens?
>
> It doesn't.
>
> > Why?
>
> Because you did one timing run when your system was under very heavy load of
> background tasks and the other when it was under very light load, most likely.
>
So, my old concept(it's just replace the source text) is right??
Then, the ones who frequently insists that using macros makes part of
the processing at compile-time is really wrong?
Going out of the original question, does someone recommend me a good
doc about how to optimize my programs, making it run fast.
>
> cheers,
> DaveK
> --
> Can't think of a witty .sigline today....
>
>