Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Oct 2005 00:46:24 +1300
From:      Mark Kirkwood <markir@paradise.net.nz>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        David Xu <davidxu@freebsd.org>, "Yuriy N. Shkandybin" <jura@networks.ru>, current@freebsd.org
Subject:   Re: Timers and timing, was: MySQL Performance 6.0rc1
Message-ID:  <43620F90.1020401@paradise.net.nz>
In-Reply-To: <28339.1130477343@critter.freebsd.dk>
References:  <28339.1130477343@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
Poul-Henning Kamp wrote:
> In message <43615BBB.2080702@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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43620F90.1020401>