|
Boost Users : |
Subject: Re: [Boost-users] accumulators: not copying doubles into the acc set
From: Dave Abrahams (dave_at_[hidden])
Date: 2012-08-01 07:43:48
on Sat Jul 07 2012, "MM" <finjulhich-AT-gmail.com> wrote:
> Now I tried to find 2 comparables ways of calculating the mean on a large
> number of doubles and time them
>
> http://codepad.org/12Uw654j
>
> Is this a fair comparison?
Nope. The version using Boost.Accumulators has to count the number of
samples, whereas the hand-coded version has the number of samples
encoded as a constant. A fair comparison would use the "sum"
accumulator and then divide by 134217728u.
-- Dave Abrahams BoostPro Computing Software Development Training http://www.boostpro.com Clang/LLVM/EDG Compilers C++ Boost
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