Timers and timing, was: MySQL Performance 6.0rc1
Mark Kirkwood
markir at paradise.net.nz
Fri Oct 28 04:46:44 PDT 2005
Poul-Henning Kamp wrote:
> In message <43615BBB.2080702 at paradise.net.nz>, Mark Kirkwood writes:
>
>>Chuck Swiger wrote:
>>
>>
>>>FreeBSD 5.4-STABLE i386
>>> null function: 0.01278
>>> getpid(): 0.51329
>>> time(): 2.54771
>>> gettimeofday(): 2.54982
>>>
>>
>>Chuck - very interesting results. I happen to have a PIII 1Ghz running
>>5.4-RELEASE so thought it would be interesting to reproduce your
>>numbers. My null and getpid pretty much do, but the time functions seem
>>much quicker on my machine - some sort of regression in 5.4-STABLE maybe?
>
>
> No, different timecounter hardware.
>
> Use
> sysctl kern.timecounter
> to see what your hardware uses.
>
Excellent - thanks for clearing that up that confusion (err... that I
was helping to propagate ...sorry).
e.g: on the 2xPIII 1Ghz Tyan (6.0-RC1):
$ sysctl -w kern.timecounter.hardware=TSC
$ ./timer
null function: 0.01140
getpid(): 0.51597
time(): 0.80246
gettimeofday(): 0.74953
$ sysctl -w kern.timecounter.hardware=i8254
$ ./timer
null function: 0.01152
getpid(): 0.52081
time(): 5.26879
gettimeofday(): 5.23759
Cheers
Mark
More information about the freebsd-current
mailing list