Boost logo

Boost Users :

Subject: Re: [Boost-users] large variant performance compared (50 elements)
From: Larry Evans (cppljevans_at_[hidden])
Date: 2011-01-21 17:04:25


On 01/17/11 14:18, Paul wrote:
> la> [snip]
>> Could you post a test driver showing the problem.
>> I'd like to see how:
>
> In rough (but working) code:
>
With the program in 1st attachment, when compiled with gcc4.5.1
with the -ftime-report option, I get the timing results shown
in 2nd attachment.

Plotting the results using:

  http://soft.proindependent.com/qtiplot.html

showed quadratic looking curves with boost::variant the
clear winner. Also with qtiplot, the curves were fitted
(pretty closely from looking at the fitted quadratics).

The log output from the fitting is shown in 3ird attachment
which shows the polynomial coefficients.

So, based on these fitting results, you might find the
boost::variant visitors faster than the CLoPtrVariant
visitors. I've no idea why a specialized visitor, like
CLoPtrVariant, would be slower than the more general one,
like boost:;variant. Indeed, the most general visitor,
OneOfMaybe, is the slowest, so there's no obvious general
rule :(

HTH.
-Larry






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