diff options
| author | Tobias Klauser <tklauser@distanz.ch> | 2018-03-02 11:27:15 +0100 |
|---|---|---|
| committer | Tobias Klauser <tobias.klauser@gmail.com> | 2018-03-03 12:12:58 +0000 |
| commit | 51b027116c2c90e7cb938362b0134ff710fea54e (patch) | |
| tree | 773d74d9a111aea28051bb7ef218675d44fce97e /src/runtime/os_linux.go | |
| parent | c69f60d0715a836b739b34a92a56c1f7d29485a6 (diff) | |
| download | go-51b027116c2c90e7cb938362b0134ff710fea54e.tar.xz | |
runtime: use vDSO for clock_gettime on linux/arm
Use the __vdso_clock_gettime fast path via the vDSO on linux/arm to
speed up nanotime and walltime. This results in the following
performance improvement for time.Now on a RaspberryPi 3 (running
32bit Raspbian, i.e. GOOS=linux/GOARCH=arm):
name old time/op new time/op delta
TimeNow 0.99µs ± 0% 0.39µs ± 1% -60.74% (p=0.000 n=12+20)
Change-Id: I3598278a6c88d7f6a6ce66c56b9d25f9dd2f4c9a
Reviewed-on: https://go-review.googlesource.com/98095
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/os_linux.go')
| -rw-r--r-- | src/runtime/os_linux.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/runtime/os_linux.go b/src/runtime/os_linux.go index 7ebca7f856..d8c1592a1d 100644 --- a/src/runtime/os_linux.go +++ b/src/runtime/os_linux.go @@ -268,6 +268,7 @@ func sysauxv(auxv []uintptr) int { } archauxv(tag, val) + vdsoauxv(tag, val) } return i / 2 } |
