]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: use vDSO for gettimeofday on linux/amd64
authorAnthony Martin <ality@pbrane.org>
Thu, 8 Nov 2012 02:29:31 +0000 (18:29 -0800)
committerAnthony Martin <ality@pbrane.org>
Thu, 8 Nov 2012 02:29:31 +0000 (18:29 -0800)
Intel Core 2 Duo (2.16 GHz) running 3.6.5-1-ARCH

benchmark       old ns/op    new ns/op    delta
BenchmarkNow         1856         1034  -44.29%

R=rsc
CC=golang-dev
https://golang.org/cl/6826072

src/pkg/runtime/sys_linux_amd64.s

index 88810ff74a05aa353464ca91bda0a9d0ce18f890..ca78ffa6f6e49c135267afe9440f0cbeef556f35 100644 (file)
@@ -104,7 +104,7 @@ TEXT runtime·mincore(SB),7,$0-24
 TEXT time·now(SB), 7, $32
        LEAQ    8(SP), DI
        MOVQ    $0, SI
-       MOVQ    $0xffffffffff600000, AX
+       MOVQ    runtime·__vdso_gettimeofday_sym(SB), AX
        CALL    AX
        MOVQ    8(SP), AX       // sec
        MOVL    16(SP), DX      // usec