Boost logo

Boost Users :

Subject: Re: [Boost-users] metafunction invocation performance
From: Hicham Mouline (hicham_at_[hidden])
Date: 2009-02-26 16:25:48

> ----- Original Message -----
> From: "David Abrahams" <dave_at_[hidden]>
> To: boost-users_at_[hidden]
> Subject: Re: [Boost-users] metafunction invocation performance
> Date: Thu, 26 Feb 2009 10:02:20 -0500
> On Jul 4, 2008, at 7:36 AM, Hicham Mouline wrote:
> > The solution to this one is provided by Joaquin, in his reply below:
> >
> > I tried compiling your code with MSVC++ 8.0 and it is indeed incredibly
> > slow. After playing a little with the code I realized that MPL views are
> > the culprit here: for some reason it is much faster to fold on a
> > vector-based computation rather than a view:
> I learned an interesting and somewhat depressing fact from Doug Gregor
> recently. Most compilers don't use a canonical representation of types.
> That is, in most compilers, int* and add_pointer<int>::type occupy separate
> pieces of storage, and the complier jumps through some complicated hoops when
> it needs to evaluate them for sameness. Of course that also means that
> vector<int*> and vector<add_pointer<int>::type> are represented separately,
> etc. That can totally skewer the gains of memoization, among other things.f
> Apparently recent versions of GCC have canonical type representation, and so
> does Clang (for what that's worth -- no C++ yet), but I betcha MS doesn't,
> and that would help explain why views cost more.

I can try to experiment with this.
I could try the view version versus the non-view version provided my Joaquin in g++.
What minimum version of g++ ?


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at