This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Use HP_TIMING for benchmarks if available


On Mon, Apr 22, 2013 at 10:31:24AM +0530, Siddhesh Poyarekar wrote:
> Ping!
> 
> On Mon, Apr 15, 2013 at 01:49:36PM +0530, Siddhesh Poyarekar wrote:
> > Here's a patch that adds support for using HP_TIMING in benchmark
> > measurements when it is available.  clock_gettime is still kept as a
> > fallback when !HP_TIMING_AVAIL

It looks like solving problem at wrong level. You could get better
interface by default implementation of HP_TIMING using clock_gettime.

> > +# define TIMING_PRINT_STATS(d_total_s, d_iters, d_total_i, max, min) \
> > +  printf (FUNCNAME ": ITERS:%g: TOTAL:%gC, MAX:%gC, MIN:%gC, %g calls/MC\n",  \
> > +	  (d_total_i), (d_total_s), (max) / (d_iters), (min) / (d_iters),     \
> > +	  1e6 * (d_total_i) / (d_total_s));

Report relevant parameters, not bunch of random ones. Average, minimum and maximum. 
Also report variance.

> > +# define TIMING_PRINT_STATS(d_total_s, d_iters, d_total_i, max, min) \
> > +  printf (FUNCNAME ": ITERS:%g: TOTAL:%gs, MAX:%gs, MIN:%gs, %g iter/s\n",    \
> > +	  (d_total_i), (d_total_s) * 1e9, (max) / (d_iters),		      \
> > +	  (min) / (d_iters), (d_total_i) / ((d_total_s) * 1e9))
> > +
> > +#endif
These numbers are totally off.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]