Boost logo

Boost Users :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2007-06-25 21:51:12


"Michael Marcin" <mmarcin_at_[hidden]> wrote in message
news:f5pev8$dfe$1_at_sea.gmane.org...
>I have written type safe wrappers around some math operations that I
> need to use everywhere and I expect and rely on them being equivalent to
> the handcoded or macro based approach for performance reasons.
>
> I tend to check the resulting assembly by hand every so often and it
> surprises me from time to time to see that inefficiencies have crept in.
>
> If I write a routine in C and a routine using the type safe wrappers
> that I expect to have equivalent generated assembly is there a way to
> test that this is indeed the case?
>
> Can anyone else think of a better way to make sure that register usage
> is optimal, proper inlining is occurring, etc?

You can make this routine a template with parameter policy type modeling
either wrapped or non-wrapped operations.

Than you can instantiate this function with wrapped and unwrapped parameter
policy. Measure and compare the performance of this calls in N invocations.

HTH,

Gennadiy


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net