Boost logo

Boost Users :

Subject: Re: [Boost-users] large variant performance compared (50 elements)
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-01-08 15:46:01


AMDG

On 1/8/2011 11:56 AM, Paul wrote:
> I've done some testing based on the suggestions:
>
> Adding a destructor to the 'dummy' types doesn't seem to make a
> difference.

Now that I've looked through the code, it's the
copy constructor and default constructor that
matter.

> Adding boost::blank as the first type however makes a hugh difference:
> <snip>
>
> Drawback of this approach seems to be that each visitor needs to have
> an operator()() receiving a boost::blank&; not a big problem anyway.
>
> I failed to apply the patch-file on the 1.38 revision; either there is
> a problem with the patch.exe that i downloaded (for win32) or the
> patch-file doesn't match this revision. When you can send me a
> modified variant.hpp based on the file attached, then i will be happy
> to run some tests.

I was able to apply the patch. I've attached it. (zipped since
it's rather large.)

> I was wondering whether the found behavior is a bug or not; after all
> it seems to be functionally correct but it just doesn't scale very
> well. When this problem can be fixed in the variant.hpp then i guess
> that's preferred but what are the consequences at functional level
> and/or runtime performance?

The functionality should be unaffected. The runtime
cost is one call through a function pointer.

In Christ,
Steven Watanabe




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