On Fri, 16 Aug 2002, Ian Holsman wrote:

> I'm just wondering if there is any kind of measureable performance
> benefit in keeping these as a macro vs putting them in a  function
> (possibly inline if the compiler can support it).

I'm quite sure there is a performance benefit, though admittedly I don't
have numbers on hand to support that at the moment.

It's as simple as this: many of the operations, once you get rid of the
typecasts and other noise, optimize down to just a few adds/subtracts and
a few assignments.  Four lines of code in most cases.  Adding the overhead
of a function call (actually probably two or three function calls) for
each operation would be substantial.

It just looks messy when you expand the macros because it all gets
squished on one line and because lots of noise gets shoved in.  But you
could say that about most macros when read in fully expanded form.

--Cliff

Reply via email to