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

Issue 7397056: code review 7397056: cmd/gc: apply escape analysis results to closures. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 2 months ago by remyoudompheng
Modified:
11 years, 2 months ago
Reviewers:
CC:
DMorsing, bradfitz, minux1, dave_cheney.net, rsc, golang-dev
Visibility:
Public.

Description

cmd/gc: apply escape analysis results to closures. This avoids an allocation when closures are used as "macros", in Walk idioms, or as argument to defer. benchmark old ns/op new ns/op delta BenchmarkSearchWrappers 1171 354 -69.77% BenchmarkCallClosure 3 3 -12.54% BenchmarkCallClosure1 119 7 -93.95% BenchmarkCallClosure2 183 74 -59.18% BenchmarkCallClosure3 187 75 -59.57% BenchmarkCallClosure4 187 76 -58.98% Compared to Go 1: benchmark old ns/op new ns/op delta BenchmarkSearchWrappers 3208 354 -88.97% Fixes issue 3520.

Patch Set 1 #

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

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

Total comments: 1

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

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

Patch Set 6 : diff -r 8e4103edc064 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -1 line) Patch
M src/cmd/gc/closure.c View 1 2 3 4 5 1 chunk +5 lines, -1 line 0 comments Download
M src/pkg/sort/search_test.go View 1 2 3 1 chunk +22 lines, -0 lines 0 comments Download

Messages

Total messages: 13
remyoudompheng
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
11 years, 2 months ago (2013-02-24 10:09:21 UTC) #1
DMorsing
LGTM
11 years, 2 months ago (2013-02-24 12:19:51 UTC) #2
bradfitz
Nice. Could you include a Go test using testing.AllocsPerRun so this can't silently regress? On ...
11 years, 2 months ago (2013-02-24 16:54:52 UTC) #3
minux1
https://codereview.appspot.com/7397056/diff/5001/src/pkg/sort/search_test.go File src/pkg/sort/search_test.go (right): https://codereview.appspot.com/7397056/diff/5001/src/pkg/sort/search_test.go#newcode120 src/pkg/sort/search_test.go:120: func BenchmarkSearchWrappers(b *testing.B) { b.ReportAllocs() ?
11 years, 2 months ago (2013-02-24 16:56:12 UTC) #4
remyoudompheng
Please take another look. On 2013/02/24 16:54:52, bradfitz wrote: > Nice. Could you include a ...
11 years, 2 months ago (2013-02-24 17:13:34 UTC) #5
bradfitz
LGTM on Go part. Thanks. On Sun, Feb 24, 2013 at 9:13 AM, <remyoudompheng@gmail.com> wrote: ...
11 years, 2 months ago (2013-02-24 17:17:14 UTC) #6
DMorsing
New patch set has chunk mismatch. Didn't someone put in a check for that in ...
11 years, 2 months ago (2013-02-24 17:17:24 UTC) #7
remyoudompheng
On 2013/02/24 17:17:24, DMorsing wrote: > New patch set has chunk mismatch. Reuploaded.
11 years, 2 months ago (2013-02-24 21:39:31 UTC) #8
dave_cheney.net
I checked the Rietveld issue tracker a few weeks back but found no issue relating ...
11 years, 2 months ago (2013-02-24 21:52:57 UTC) #9
bradfitz
Folks work on Rietveld? On Feb 24, 2013 1:52 PM, "Dave Cheney" <dave@cheney.net> wrote: > ...
11 years, 2 months ago (2013-02-24 22:54:36 UTC) #10
rsc
Yes. folks do work on Rietveld, mainly people from the Go and Chromium projects. You ...
11 years, 2 months ago (2013-02-25 16:31:42 UTC) #11
rsc
LGTM
11 years, 2 months ago (2013-02-25 16:33:44 UTC) #12
remyoudompheng
11 years, 2 months ago (2013-02-25 23:40:41 UTC) #13
*** Submitted as https://code.google.com/p/go/source/detail?r=37a172cbde23 ***

cmd/gc: apply escape analysis results to closures.

This avoids an allocation when closures are used
as "macros", in Walk idioms, or as argument to defer.

benchmark                old ns/op    new ns/op    delta
BenchmarkSearchWrappers       1171          354  -69.77%
BenchmarkCallClosure             3            3  -12.54%
BenchmarkCallClosure1          119            7  -93.95%
BenchmarkCallClosure2          183           74  -59.18%
BenchmarkCallClosure3          187           75  -59.57%
BenchmarkCallClosure4          187           76  -58.98%

Compared to Go 1:
benchmark                  old ns/op    new ns/op    delta
BenchmarkSearchWrappers         3208          354  -88.97%

Fixes issue 3520.

R=daniel.morsing, bradfitz, minux.ma, dave, rsc
CC=golang-dev
https://codereview.appspot.com/7397056
Sign in to reply to this message.

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