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

Issue 4527091: code review 4527091: gc: make merely referencing an outer variable in a clos... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 10 months ago by lvd
Modified:
13 years, 10 months ago
Reviewers:
CC:
rsc, golang-dev
Visibility:
Public.

Description

gc: make merely referencing an outer variable in a closure not force heapallocation. before: runtime_test.BenchmarkCallClosure1 20000000 135 ns/op after: runtime_test.BenchmarkCallClosure1 500000000 6 ns/op

Patch Set 1 #

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

Patch Set 3 : diff -r 96d9616ffbad https://go.googlecode.com/hg/ #

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

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

Total comments: 4

Patch Set 6 : diff -r 96d9616ffbad https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+73 lines, -25 lines) Patch
M src/cmd/gc/closure.c View 1 2 2 chunks +5 lines, -1 line 0 comments Download
M src/cmd/gc/dcl.c View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/cmd/gc/go.h View 1 3 chunks +6 lines, -4 lines 0 comments Download
M src/cmd/gc/typecheck.c View 1 2 3 4 5 8 chunks +29 lines, -20 lines 0 comments Download
M src/pkg/runtime/closure_test.go View 1 1 chunk +32 lines, -0 lines 0 comments Download

Messages

Total messages: 4
lvd
Hello rsc@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 10 months ago (2011-06-01 14:25:28 UTC) #1
rsc
LGTM http://codereview.appspot.com/4527091/diff/8002/src/cmd/gc/typecheck.c File src/cmd/gc/typecheck.c (right): http://codereview.appspot.com/4527091/diff/8002/src/cmd/gc/typecheck.c#newcode1030 src/cmd/gc/typecheck.c:1030: if (n->left->type->type ==types[TUINT8]) while you're here, s/==/== / ...
13 years, 10 months ago (2011-06-01 14:57:04 UTC) #2
lvd
http://codereview.appspot.com/4527091/diff/8002/src/cmd/gc/typecheck.c File src/cmd/gc/typecheck.c (right): http://codereview.appspot.com/4527091/diff/8002/src/cmd/gc/typecheck.c#newcode1030 src/cmd/gc/typecheck.c:1030: if (n->left->type->type ==types[TUINT8]) On 2011/06/01 14:57:04, rsc wrote: > ...
13 years, 10 months ago (2011-06-01 15:02:14 UTC) #3
lvd
13 years, 10 months ago (2011-06-01 15:02:51 UTC) #4
*** Submitted as http://code.google.com/p/go/source/detail?r=de48d4bcd09d ***

gc: make merely referencing an outer variable in a closure not force
heapallocation.

before: runtime_test.BenchmarkCallClosure1       20000000              135 ns/op
after:  runtime_test.BenchmarkCallClosure1      500000000                6 ns/op

R=rsc
CC=golang-dev
http://codereview.appspot.com/4527091
Sign in to reply to this message.

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