Boost logo

Boost :

Subject: Re: [boost] Interest in a tweener library
From: Julien Jorge (julien.jorge_at_[hidden])
Date: 2012-07-15 07:30:45


Le Sun, 15 Jul 2012 11:29:06 +0200,
Klaim - Joël Lamotte <mjklaim_at_[hidden]> a écrit :

> On Sat, Jul 14, 2012 at 9:17 PM, Julien Jorge
> <julien.jorge_at_[hidden]>wrote:
>
> > For the performance, I don't think they should be inlined. First, I
> > have no measure to tell that there is a performance bottleneck in
> > the use of the ease functions. Then, the functions are passed as an
> > argument to the constructor of single_tweener. I don't see how the
> > compiler could inline a function used this way.
> >
>
> I don't know what you mean exactly, but i'm not a specialist either
> and I didn't benchmark anything.
> By the way, you suggest that the library would not be header-only? Or
> you don't mind if it is asked to be?
>

I don't mind if it is asked to be header only, and actually a template
implementation using the the vectorized approach suggested by Rhys
Ulerich seems interesting.

What I say however is that I do not see how the compiler can inline the
function f() in the following situation (that represents how the
ease functions are used):

  inline double f( double )
  {
    // …
  }

  void g( boost::function<double (double)>& func )
  {
    double t = /* … */;
    double d = func( t );
    // …
  }

  int main()
  {
    g( &f );
  }

Since the address of f is used in the call to g, I suppose that the
compiler cannot inline the call in g.

Regards,

Julien Jorge


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk