|
Boost : |
From: Geoffrey Irving (irving_at_[hidden])
Date: 2006-09-09 14:06:45
On Sat, Sep 09, 2006 at 06:27:40PM +0800, Joel de Guzman wrote:
> Andy Little wrote:
>
> >> You must've missed this: Dan wrote me an email a while back. He
> >> says: "Interestingly using fusion::fold to do maths on boost::arrays,
> >> I'm finding that with vc8.0 fusion significantly outperforms the
> >> standard library equivalent code, presumably as it has more
> >> information available at compile time, and with inlining it
> >> effectively unrolls the entire loops."
> >>
> >> I asked Dan to add his tests to libs/fusion/example to showcase
> >> this favorable "phenomena" :-).
> >
> > I can't find that, but I am probably looking in the wrong place. Do you mean
> > Boost CVS?
>
> Sorry, you'll have to wait a bit more. Dan says he'll do it over
> the weekend.
I think the main reason for this is that inlining a fusion loop means that
the compiler has obeyed an explicit programmer suggestion (inline), whereas
unrolling a constant size array loop is loop unrolling, which is impossible
to suggest to the compiler (and typically requires higher -O levels, etc.).
A while back when I implemented a vector type with constant size for loops,
it slowed down the whole application by 30%.
I'm very curious to see how much better fusion can do. Andy: is your
fusion code in an easily accessible place where I could grab it and stick
some of it into our vector class to test it in a (probably) larger example?
The main issue is whether the compile will still choose to unroll
everything if it sees a bunch of vector operations inside various
complicated functions.
Thanks,
Geoffrey
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk