[PATCH] randomize benchtests
Allan McRae
allan@archlinux.org
Tue Apr 23 08:54:00 GMT 2013
On 23/04/13 04:24, Siddhesh Poyarekar wrote:
> 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.
>
I have no opinion on the output beyond that the number of iterations
would be useful to include.
Allan
More information about the Libc-alpha
mailing list