Subject: Re: [Boost-bugs] [Boost C++ Libraries] #12248: boost::log::attributes:timer accuracy shift
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-07-17 15:07:41
#12248: boost::log::attributes:timer accuracy shift
-------------------------------+-----------------------
Reporter: tib | Owner: andysem
Type: Bugs | Status: closed
Milestone: To Be Determined | Component: log
Version: Boost 1.61.0 | Severity: Problem
Resolution: invalid | Keywords: log timer
-------------------------------+-----------------------
Changes (by andysem):
* status: new => closed
* resolution: => invalid
Comment:
I believe your `PreciseTimer` is less precise than the timer the library
offers. In particular, your code involves FP operations on the number of
ticks since the timer construction:
{{{
double e = (nowCounter.QuadPart - m_startCounter.QuadPart) / (double)
m_freq.QuadPart;
}}}
As the difference grows, the precision of `double` becomes insufficient.
The library code is also faster since it avoids division in the hot path.
I admit, the implementation could be made more precise if 128-bit integer
math was used instead of FP math, but I suspect it would be much slower
yet.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/12248#comment:1> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:20 UTC