This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Use HP_TIMING for benchmarks if available
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Siddhesh Poyarekar <siddhesh at redhat dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 22 Apr 2013 16:55:02 +0200
- Subject: Re: [PATCH] Use HP_TIMING for benchmarks if available
- References: <20130415081936 dot GN9444 at spoyarek dot pnq dot redhat dot com> <20130422050122 dot GC1412 at spoyarek dot pnq dot redhat dot com>
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.