]> Cypherpunks repositories - gostls13.git/commit
runtime: use OS X vsyscall for gettimeofday (amd64)
authorRuss Cox <rsc@golang.org>
Tue, 5 Jun 2012 20:24:37 +0000 (16:24 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 5 Jun 2012 20:24:37 +0000 (16:24 -0400)
commit3a66bc415e674ed0ba2dd55ec7ef413fcac3778e
treeedffba3c8ce01a75cd35108091099951e5f4d9fa
parentc7be4defe31fbcbae028b382c707361d28d5d7ca
runtime: use OS X vsyscall for gettimeofday (amd64)

Thanks to Dave Cheney for the magic words "comm page".

benchmark       old ns/op    new ns/op    delta
BenchmarkNow          197           33  -83.05%

This should make profiling a little better on OS X.
The raw time saved is unlikely to matter: what likely matters
more is that it seems like OS X sends profiling signals on the
way out of system calls more often than it should; avoiding
the system call should increase the accuracy of cpu profiles.

The 386 version would be similar but needs to do different
math for CPU speeds less than 1 GHz. (Apparently Apple has
never shipped a 64-bit CPU with such a slow clock.)

R=golang-dev, bradfitz, dave, minux.ma, r
CC=golang-dev
https://golang.org/cl/6275056
src/pkg/runtime/sys_darwin_amd64.s