Boost logo

Boost :

Subject: Re: [boost] [Block Pointer] benchmark
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-05-25 08:10:21


On 25/05/2011 02:33, Darren Garvey wrote:

> template<typename T, T (*P)()>
> void worker_make()
> {
> for (int i = 0; i< 100000; ++ i)
> T p = P();
> }

This is a fairly bad way to write a benchmark, and is likely to yield
somewhat incorrect results.

You should bench based on an external condition, such as time, rather
than making a fixed number of iterations.


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