Subject: Re: [boost] What's wrong with this benchmark
From: Michael Marcin (mike.marcin_at_[hidden])
Date: 2016-02-19 02:50:07
On 2/19/2016 12:48 AM, Benedek Thaler wrote:
> On Thu, Feb 18, 2016 at 8:51 AM, Michael Marcin <mike.marcin_at_[hidden]> wrote:
>> I think there is definitely something not quite right.
>> One thing I notice is that the line:
>> sample.push_back(get_clock() - base_clock);
>> Is being timed.
>> Which could potentially access a new memory page I think.
>> In pin_thread you have _MSVC_VER instead of _MSC_VER
> Good catch, fixed this.
>> Hacking up std::vector and adding a push_back_reserved that does no bounds
>> checks I get consistently very strange timings.
>> (Code included at the bottom to make it obvious that the latter should be no
>> My simpler, and I'm sure in many ways inferior benchmark, shows much more
>> believable results.
> Still, there are huge differences between essentially same programs.
> I gave a spin to rdtscp, no success, but I continue looking at this doc.
FWIW (probably not much this time)
I took a shot at porting my test to the google/benchmark library.
Mostly just to learn the library but also to see if there were any
Not sure I'm using it right but the relative results seem in line with
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk