cvs commit: src/usr.sbin/moused moused.c

Peter Jeremy peterjeremy at
Thu Mar 6 09:54:11 UTC 2008

On Thu, Mar 06, 2008 at 10:20:45AM +0100, Roman Divacky wrote:
>On Thu, Mar 06, 2008 at 12:22:17AM +0000, Jung-uk Kim wrote:
>>   Prefer clock_gettime(2) over gettimeofday(2) and use CLOCK_MONOTONIC_FAST.
>>   It is only used to track elapsed time and it does not have to be precise.
>what is the rationale behind this? what is the expected improvement? I am
>not questioning the change I am just curious..

There's been a recent extensive thread about poor X11 performance and
it turns out the the Xserver can issue multiple gettimeofday(2) calls
every time it sees a mouse movement.  gettimeofday(2) on FreeBSD is
relatively expensive (the Project chose accuracy over speed) and
clock_gettime(2) using CLOCK_MONOTONIC_FAST is a much cheaper
alternative when accuracy isn't critical.

The Xserver should be using clock_gettime(2) but there's a bug in its
POSIX-compatibility selection.  Applying a similar fix to moused is a
logical extension.

Peter Jeremy
Please excuse any delays as the result of my ISP's inability to implement
an MTA that is either RFC2821-compliant or matches their claimed behaviour.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the cvs-src mailing list