This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] randomize benchtests
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: chrubis at suse dot cz
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 22 Apr 2013 16:50:11 +0200
- Subject: Re: [PATCH] randomize benchtests
- References: <20130422120018 dot GA30323 at domone dot kolej dot mff dot cuni dot cz> <20130422134642 dot GA4707 at rei>
On Mon, Apr 22, 2013 at 03:46:42PM +0200, chrubis@suse.cz wrote:
> Hi!
> > Do you know more portable way to get CPU frequency than reading /dev/cpuinfo?
> > I need that to display data at cycles which are more natural unit than
> > nanoseconds.
>
> You can use 'cpufreq-info -f' on Linux, on BSD's you need to play with
> sysctl. There is a sysctl 'emulation' on Linux that uses /proc, but that
> doesn't work for CPU speed.
>
It looks that reading file is saner than exec followed by reading
output.
> But be wary that CPU speed is subject to change when CPU scaling is
> active, which is on on most of the modern systems.
>
This with other factors is reason why we should test all implementations
together and select implementations randomly. They will be affected by
same amount so their speed differences will not be affected.
When we test them sequentialy overhead will be different each time
making comparing them almost worthless.
> --
> Cyril Hrubis
> chrubis@suse.cz