Timers and timing, was: MySQL Performance 6.0rc1

David Xu davidxu at freebsd.org
Fri Oct 28 03:30:24 PDT 2005


David Xu wrote:
> Poul-Henning Kamp wrote:
> 
>> In message <4361F057.4030904 at pp.nic.fi>, Pertti Kosunen writes:
>>
>>
>>> Does polling affect to this test?
>>
>>
>>
>> Not apart from the CPU overhead.
>>
>>     sysctl kern.timecounter.hardware
>>
>> is much more important.
>>
>> and all the reports here which fail to include it are mostly
>> useless.
>>
>>
> I suspect because our time() function in libc uses gettimeofday,
> this further causes lots of gettimeofday syscall.
> 
> 
Now, I can confirm mysqld calls time() function lots of time, I have
changed time() to call clock_gettime, now there is few of gettimeofday 
in ktrace result, but fully filled by clock_gettime.
Can we optimize time()? because it only returns second.
may we just create a syscall to return time_second variable in kernel, 
this sounds crazy though.



More information about the freebsd-current mailing list