Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(18)

Issue 6814103: code review 6814103: runtime: use vDSO clock_gettime for time.now & runtime.... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 7 months ago by minux1
Modified:
9 years, 7 months ago
Reviewers:
CC:
golang-dev, bradfitz, iant, iant2
Visibility:
Public.

Description

runtime: use vDSO clock_gettime for time.now & runtime.nanotime on Linux/amd64 Performance improvement aside, time.Now() now gets real nanosecond resolution on supported systems. Benchmark done on Core i7-2600 @ 3.40GHz with kernel 3.5.2-gentoo. original vDSO gettimeofday: BenchmarkNow 100000000 27.4 ns/op new vDSO gettimeofday fallback: BenchmarkNow 100000000 27.6 ns/op new vDSO clock_gettime: BenchmarkNow 100000000 24.4 ns/op

Patch Set 1 #

Patch Set 2 : diff -r e3d1b93bfa09 https://code.google.com/p/go #

Patch Set 3 : diff -r f4796b726694 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -11 lines) Patch
M src/pkg/runtime/sys_linux_amd64.s View 1 1 chunk +16 lines, -10 lines 0 comments Download
M src/pkg/runtime/vdso_linux_amd64.c View 1 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 8
minux1
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go
9 years, 7 months ago (2012-11-08 10:47:23 UTC) #1
minux1
this CL lets runtime.nanotime call time.now. if necessary, i can duplicate time.now code for runtime.nanotime ...
9 years, 7 months ago (2012-11-08 10:54:49 UTC) #2
minux1
FYI, on linux/386, using clock_gettime actually slows time.now() down. 110 ns/op vs. 118 ns/op. This ...
9 years, 7 months ago (2012-11-08 13:23:07 UTC) #3
bradfitz
My personal opinion is that a 8 ns loss on a platform where people don't ...
9 years, 7 months ago (2012-11-08 16:23:52 UTC) #4
iant
LGTM
9 years, 7 months ago (2012-11-08 16:43:10 UTC) #5
minux1
what do you think of using clock_gettime on all unix systems where ns resolution is ...
9 years, 7 months ago (2012-11-08 16:50:22 UTC) #6
iant2
On Thu, Nov 8, 2012 at 8:50 AM, minux <minux.ma@gmail.com> wrote: > what do you ...
9 years, 7 months ago (2012-11-08 17:14:25 UTC) #7
minux1
9 years, 7 months ago (2012-11-09 06:19:19 UTC) #8
*** Submitted as http://code.google.com/p/go/source/detail?r=42c8d3aadc40 ***

runtime: use vDSO clock_gettime for time.now & runtime.nanotime on Linux/amd64
Performance improvement aside, time.Now() now gets real nanosecond resolution
on supported systems.

Benchmark done on Core i7-2600 @ 3.40GHz with kernel 3.5.2-gentoo.
original vDSO gettimeofday:
BenchmarkNow    100000000               27.4 ns/op
new vDSO gettimeofday fallback:
BenchmarkNow    100000000               27.6 ns/op
new vDSO clock_gettime:
BenchmarkNow    100000000               24.4 ns/op

R=golang-dev, bradfitz, iant, iant
CC=golang-dev
http://codereview.appspot.com/6814103
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b