Boost logo

Boost :

Subject: Re: [boost] [histogram] Variance
From: Hans Dembinski (hans.dembinski_at_[hidden])
Date: 2018-09-18 07:44:06


> On 18. Sep 2018, at 09:41, Hans Dembinski <hans.dembinski_at_[hidden]> wrote:
>
> there is a minor overhead in the return value. Whenever you query the adaptive_storage, two doubles - one for the value and one for the variance -, which is slightly wasteful if you don't care about the variance, then you would need only one double. I don't know how smart compilers are in this case, the compiler may even remove the code that fills the second double when it is not used. In memory, the adaptive_storage uses only a single integer for each counter if you don't use weighted fills.

Ah, sorry, I don't have a stroke, I am just an hurry, should have read again before sending.

There is a minor overhead when the return value is created as you call ".at(…)". Whenever you query the adaptive_storage, two doubles are filled - one for the value and one for the variance -, which is slightly wasteful if you don't care about the variance. In that case, you would need only one double. I don't know how smart compilers are in this case, the compiler may even remove the code that fills the second double if it is not used. In memory, the adaptive_storage uses only a single integer for each counter if you don't use weighted fills.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk