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 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


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