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: Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>
- To: Ondřej Bílka <neleai at seznam dot cz>
- Cc: Siddhesh Poyarekar <siddhesh at redhat dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 23 Apr 2013 00:01:02 +0530
- 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> <20130422145502 dot GA31451 at domone dot kolej dot mff dot cuni dot cz>
On 22 April 2013 20:25, OndÅej BÃlka <neleai@seznam.cz> wrote:
> 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.
I'm not sure I understand. Do you mean that I should be redefining
HP_TIMING macros here? I deliberately avoided doing that since I
wanted to avoid overriding glibc internal bits.
>> > +# 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.
I'm going to leave discussion on this for your patch. If your changes
get acked there, then I'll update this here.
>> > +# 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.
Again I don't understand what you mean here. Please elaborate.
Thanks,
Siddhesh
--
http://siddhesh.in