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

Issue 5297078: code review 5297078: time: faster Nanoseconds call (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 4 months ago by rsc
Modified:
13 years, 4 months ago
Reviewers:
CC:
golang-dev, dsymonds, dave_cheney.net, hector, r, cw
Visibility:
Public.

Description

time: faster Nanoseconds call runtime knows how to get the time of day without allocating memory.

Patch Set 1 #

Patch Set 2 : diff -r b9dca3b10c42 https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 3 : diff -r 67689e3aadad https://go.googlecode.com/hg/ #

Total comments: 4

Patch Set 4 : diff -r cdf4e4406ff6 https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r a4677b96f3ae https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+130 lines, -111 lines) Patch
M src/pkg/runtime/Makefile View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/pkg/runtime/darwin/386/sys.s View 1 2 1 chunk +15 lines, -8 lines 0 comments Download
M src/pkg/runtime/darwin/amd64/sys.s View 1 2 1 chunk +8 lines, -6 lines 0 comments Download
M src/pkg/runtime/freebsd/386/sys.s View 1 2 1 chunk +17 lines, -9 lines 0 comments Download
M src/pkg/runtime/freebsd/amd64/sys.s View 1 2 1 chunk +8 lines, -8 lines 0 comments Download
M src/pkg/runtime/linux/386/sys.s View 1 2 1 chunk +16 lines, -9 lines 0 comments Download
M src/pkg/runtime/linux/amd64/sys.s View 1 2 1 chunk +8 lines, -8 lines 0 comments Download
M src/pkg/runtime/linux/arm/sys.s View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M src/pkg/runtime/openbsd/386/sys.s View 1 2 1 chunk +16 lines, -9 lines 0 comments Download
M src/pkg/runtime/openbsd/amd64/sys.s View 1 2 1 chunk +8 lines, -8 lines 0 comments Download
M src/pkg/runtime/plan9/386/signal.c View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 2 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/runtime/runtime.c View 1 2 1 chunk +0 lines, -12 lines 0 comments Download
A src/pkg/runtime/time.goc View 1 2 1 chunk +13 lines, -0 lines 0 comments Download
M src/pkg/runtime/windows/thread.c View 1 2 3 5 chunks +10 lines, -14 lines 0 comments Download
M src/pkg/time/sys.go View 1 2 3 1 chunk +4 lines, -14 lines 0 comments Download

Messages

Total messages: 15
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 4 months ago (2011-11-02 21:33:06 UTC) #1
dsymonds
LGTM Seems odd to put the C code for pkg time in the runtime dir, ...
13 years, 4 months ago (2011-11-02 21:37:57 UTC) #2
dave_cheney.net
This is a great improvement. It will remove one allocation in the fast path on ...
13 years, 4 months ago (2011-11-02 21:46:26 UTC) #3
rsc
On Wed, Nov 2, 2011 at 17:46, Dave Cheney <dave@cheney.net> wrote: > This is a ...
13 years, 4 months ago (2011-11-02 21:49:24 UTC) #4
dave_cheney.net
Thanks for explanation, I was thinking that FLUSH caused a memory fence. On Thu, Nov ...
13 years, 4 months ago (2011-11-02 21:51:53 UTC) #5
hector
This won't work on Windows because gettime doesn't actually return the current time - it's ...
13 years, 4 months ago (2011-11-02 22:48:26 UTC) #6
r
http://codereview.appspot.com/5297078/diff/1001/src/pkg/runtime/runtime.c File src/pkg/runtime/runtime.c (right): http://codereview.appspot.com/5297078/diff/1001/src/pkg/runtime/runtime.c#newcode670 src/pkg/runtime/runtime.c:670: time·Nanoseconds(int64 ret) i'd be happier if this were in ...
13 years, 4 months ago (2011-11-02 22:50:47 UTC) #7
rsc
PTAL I moved the time stuff into time.goc, which is the canonical way to provide ...
13 years, 4 months ago (2011-11-03 16:08:57 UTC) #8
hector
GetSystemTimeAsFileTime is what currently provides the time to time.Nanoseconds. The FileTime is then converted with ...
13 years, 4 months ago (2011-11-03 16:56:13 UTC) #9
hector
http://codereview.appspot.com/5297078/diff/5/src/pkg/runtime/windows/thread.c File src/pkg/runtime/windows/thread.c (left): http://codereview.appspot.com/5297078/diff/5/src/pkg/runtime/windows/thread.c#oldcode205 src/pkg/runtime/windows/thread.c:205: runtime·stdcall(runtime·QueryPerformanceCounter, 1, &count); References to QueryPerformanceCounter and QueryPerformanceFrequency should ...
13 years, 4 months ago (2011-11-03 16:58:59 UTC) #10
cw
Before: 151 ns/call After: 44ns/call LGTM!
13 years, 4 months ago (2011-11-03 17:06:44 UTC) #11
r
LGTM http://codereview.appspot.com/5297078/diff/5/src/pkg/runtime/plan9/386/signal.c File src/pkg/runtime/plan9/386/signal.c (right): http://codereview.appspot.com/5297078/diff/5/src/pkg/runtime/plan9/386/signal.c#newcode10 src/pkg/runtime/plan9/386/signal.c:10: return 0; // TODO? http://codereview.appspot.com/5297078/diff/5/src/pkg/runtime/windows/thread.c File src/pkg/runtime/windows/thread.c (right): ...
13 years, 4 months ago (2011-11-03 17:35:02 UTC) #12
rsc
Hector, PTAL at the Windows changes. Now calling GetSystemTimeAsFileTime. There's a name I haven't heard ...
13 years, 4 months ago (2011-11-03 19:33:02 UTC) #13
hector
Windows changes LGTM.
13 years, 4 months ago (2011-11-03 20:14:08 UTC) #14
rsc
13 years, 4 months ago (2011-11-03 21:35:32 UTC) #15
*** Submitted as http://code.google.com/p/go/source/detail?r=c8c9ccd19020 ***

time: faster Nanoseconds call

runtime knows how to get the time of day
without allocating memory.

R=golang-dev, dsymonds, dave, hectorchu, r, cw
CC=golang-dev
http://codereview.appspot.com/5297078
Sign in to reply to this message.

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