This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] randomize benchtests
- From: Siddhesh Poyarekar <siddhesh dot poyarekar at gmail dot com>
- To: Ondřej Bílka <neleai at seznam dot cz>
- Cc: c at domone dot kolej dot mff dot cuni dot cz, GNU C Library <libc-alpha at sourceware dot org>
- Date: Mon, 22 Apr 2013 23:54:55 +0530
- Subject: Re: [PATCH] randomize benchtests
- References: <20130422120018 dot GA30323 at domone dot kolej dot mff dot cuni dot cz> <CAAHN_R1pHJLoS3iP7KrQMmA4gPLawvuRWoK8Xy13VPMBbyPk+Q at mail dot gmail dot com> <20130422125625 dot GA30639 at domone dot kolej dot mff dot cuni dot cz>
On 22 April 2013 18:26, OndÅej BÃlka <neleai@seznam.cz> wrote:
>> > + int seed = 42;
>>
>> You get the same sequence all the time. Use getpid() as seed or even time().
>>
> And this is precisely as intended. With that randomization you would get
> different results each time and we want this to be predictable.
OK.
> This is not wrong. You are interested only on differences between
> implementations and adding same time from rand_r calls does not change
> that.
Um yeah, but I have been working towards reducing overhead anyway so
this seems like a step backward. Anyway, rand_r is constant time, so
it shouldn't be that bad.
>> If you have total iterations and iters/sec, you can compute average
>> directly. You've gotten rid of two pieces of core information to add
>> one piece of derived information. I am not very picky about what the
>> output looks like though.
> Well expected value is most important statistical property. Yes, you can
> take iters/sec and mentally convert them to average time. But I thougth
> that purpose of computers is simplify tasks that can be performed
> mechanicaly.
>
> Total iterations are useless implementation detail and you should print
> only usefull data.
The point of keeping total iters was that this was intended to be raw
data, which can be manipulated by a frontend.
Anyway, this looks fine to me, but I'd like another reviewer to go
through it since I don't have much of an opinion about the output, but
someone else may.
Siddhesh
--
http://siddhesh.in