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

Issue 43040043: code review 43040043: reflect: rewrite Value to separate out pointer vs. nonp... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 4 months ago by khr
Modified:
10 years, 1 month ago
Reviewers:
dfc, ugorji, rsc, dvyukov
CC:
golang-dev, iant, rsc, khr1
Visibility:
Public.

Description

reflect: rewrite Value to separate out pointer vs. nonpointer info. Needed for precise gc and copying stacks. reflect.Value now takes 4 words instead of 3. Still to do: - un-iword-ify channel ops. - un-iword-ify method receivers.

Patch Set 1 #

Patch Set 2 : diff -r 04f0931c9808 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 3 : diff -r 04f0931c9808 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 4 : diff -r 04f0931c9808 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 5 : diff -r 04f0931c9808 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 6 : diff -r d99f48a196e6 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 7 : diff -r d99f48a196e6 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 8 : diff -r d99f48a196e6 https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 9 : diff -r 455c7e94abfc https://khr%40golang.org@code.google.com/p/go/ #

Total comments: 21

Patch Set 10 : diff -r 455c7e94abfc https://khr%40golang.org@code.google.com/p/go/ #

Total comments: 3

Patch Set 11 : diff -r 455c7e94abfc https://khr%40golang.org@code.google.com/p/go/ #

Patch Set 12 : diff -r e5776ade4bc0 https://khr%40golang.org@code.google.com/p/go/ #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+462 lines, -382 lines) Patch
M src/pkg/reflect/makefunc.go View 1 2 3 chunks +3 lines, -3 lines 0 comments Download
M src/pkg/reflect/type.go View 1 2 2 chunks +3 lines, -1 line 0 comments Download
M src/pkg/reflect/value.go View 1 2 3 4 5 6 7 8 9 10 74 chunks +412 lines, -288 lines 1 comment Download
M src/pkg/runtime/hashmap.c View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +44 lines, -90 lines 0 comments Download

Messages

Total messages: 19
khr
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://khr%40golang.org@code.google.com/p/go/
10 years, 4 months ago (2013-12-17 19:14:18 UTC) #1
iant
https://codereview.appspot.com/43040043/diff/120002/src/pkg/reflect/value.go File src/pkg/reflect/value.go (right): https://codereview.appspot.com/43040043/diff/120002/src/pkg/reflect/value.go#newcode66 src/pkg/reflect/value.go:66: // is set, or for for any pointer-like values. ...
10 years, 4 months ago (2013-12-18 02:11:36 UTC) #2
rsc
i assume you plan to do the "still to do" in other CLs. https://codereview.appspot.com/43040043/diff/120002/src/pkg/reflect/value.go File ...
10 years, 4 months ago (2013-12-18 03:56:48 UTC) #3
khr1
On Tue, Dec 17, 2013 at 6:11 PM, <iant@golang.org> wrote: > > https://codereview.appspot.com/43040043/diff/120002/src/ > pkg/reflect/value.go ...
10 years, 4 months ago (2013-12-19 02:07:10 UTC) #4
khr1
On Tue, Dec 17, 2013 at 7:56 PM, <rsc@golang.org> wrote: > i assume you plan ...
10 years, 4 months ago (2013-12-19 02:07:17 UTC) #5
rsc
LGTM https://codereview.appspot.com/43040043/diff/150001/src/pkg/reflect/value.go File src/pkg/reflect/value.go (right): https://codereview.appspot.com/43040043/diff/150001/src/pkg/reflect/value.go#newcode112 src/pkg/reflect/value.go:112: // pointer() returns the underlying pointer represented by ...
10 years, 4 months ago (2013-12-19 17:13:06 UTC) #6
khr
*** Submitted as https://code.google.com/p/go/source/detail?r=ecccf07e7f9d *** reflect: rewrite Value to separate out pointer vs. nonpointer info. ...
10 years, 4 months ago (2013-12-19 23:15:30 UTC) #7
dvyukov
FYI, this caused ~50% degradation of json benchmark: http://goperfd.appspot.com/perfdetail?commit=ecccf07e7f9d341ca577433b794ab8061fbdc092&commit0=e5776ade4bc02d937c9100c0ce79395e76cff614&kind=benchmark&benchmark=json
10 years, 4 months ago (2013-12-20 08:59:21 UTC) #8
khr1
So what incantation do I need to do to reproduce this on the command line? ...
10 years, 4 months ago (2013-12-20 23:08:05 UTC) #9
dfc
Here is what I used 2004 hg update -r e5776ade4bc02d937c9100c0ce79395e76cff614 2005 ./make.bash 2006 go test ...
10 years, 4 months ago (2013-12-20 23:12:45 UTC) #10
ugorji
The performance hit was not just on json. I upgraded, and saw severe degradation on ...
10 years, 4 months ago (2013-12-20 23:20:32 UTC) #11
rsc
It's possible that //go:noescape annotations will help. I forgot to reply to that question. Russ
10 years, 4 months ago (2013-12-20 23:34:18 UTC) #12
khr1
See 44990043, the performance regression was due to struct copies being inlined for 3-word structures ...
10 years, 4 months ago (2013-12-21 18:00:39 UTC) #13
dvyukov
https://codereview.appspot.com/43040043/diff/190001/src/pkg/reflect/value.go File src/pkg/reflect/value.go (right): https://codereview.appspot.com/43040043/diff/190001/src/pkg/reflect/value.go#newcode73 src/pkg/reflect/value.go:73: scalar uintptr I am curious, can we put interface{} ...
10 years, 3 months ago (2014-01-16 06:55:05 UTC) #14
khr1
Yes, I'd like to get get Value back to 3 words by doing this. It ...
10 years, 3 months ago (2014-01-16 07:49:04 UTC) #15
dvyukov
Great! On Thu, Jan 16, 2014 at 11:49 AM, Keith Randall <khr@google.com> wrote: > Yes, ...
10 years, 3 months ago (2014-01-16 08:11:13 UTC) #16
ugorji
Hi, Will this change https://codereview.appspot.com/52670045/ make it in to go 1.3? It seems like it ...
10 years, 1 month ago (2014-02-27 10:31:39 UTC) #17
khr1
No, that change is not working yet. On Thu, Feb 27, 2014 at 2:31 AM, ...
10 years, 1 month ago (2014-02-27 16:10:02 UTC) #18
dvyukov
10 years, 1 month ago (2014-02-27 17:22:35 UTC) #19
Filed an issue for 1.4
https://code.google.com/p/go/issues/detail?id=7425


On Thu, Feb 27, 2014 at 8:10 PM, Keith Randall <khr@google.com> wrote:
> No, that change is not working yet.
>
>
> On Thu, Feb 27, 2014 at 2:31 AM, Ugorji <ugorji@gmail.com> wrote:
>>
>> Hi,
>>
>> Will this change https://codereview.appspot.com/52670045/ make it in to go
>> 1.3? It seems like it would have a clear performance impact for code using
>> reflection (fmt, json, gob, other codecs, etc).
>>
>> Thanks.
>>
>> On Thursday, January 16, 2014 2:49:04 AM UTC-5, Keith Randall wrote:
>>>
>>> Yes, I'd like to get get Value back to 3 words by doing this.  It isn't
>>> trivial, you have to handle flagAddr correctly and makefunc gets
>>> complicated.  I have a start on it, CL 52670045.
>>>
>>>
>>>
>>> On Wed, Jan 15, 2014 at 10:55 PM, <dvy...@google.com> wrote:
>>>>
>>>>
>>>>
>>>>
https://codereview.appspot.com/43040043/diff/190001/src/pkg/reflect/value.go
>>>> File src/pkg/reflect/value.go (right):
>>>>
>>>>
>>>>
https://codereview.appspot.com/43040043/diff/190001/src/pkg/reflect/value.go#...
>>>> src/pkg/reflect/value.go:73: scalar uintptr
>>>> I am curious, can we put interface{} here, which is exactly {type,
>>>> word}. And then use unsafe to split it into words and manipulate them
>>>> directly. Or something along these lines?
>>>> The point is that compiler/GC must handle interface{}'s in a type-safe
>>>> manner one way or another, regardless of the fact that the word can be
>>>> pointer or not. So we can take advantage of this support to also have
>>>> "maybe pointer" word if we pretend that it is interface{}.
>>>>
>>>> https://codereview.appspot.com/43040043/
>>>
>>>
>
Sign in to reply to this message.

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