New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

runtime: remove unnecessary allocations in convT2E #8892

Open
dvyukov opened this Issue Oct 7, 2014 · 6 comments

Comments

Projects
None yet
5 participants
@dvyukov
Member

dvyukov commented Oct 7, 2014

This was at lengths discussed in:
https://golang.org/issue/8405
and previously on golang-dev:
https://groups.google.com/d/msg/golang-dev/pwUh0BVFpY0/zqJInvU3NkQJ

Namely, we should allocate heap block for scalars iff the scalar look like a pointer
into heap (otherwise GC will ignore it anyway).

This will allow to have 1-bit/word GC pointer type info *and* don't allocate additional
memory for scalars in interfaces in most cases.
@randall77

This comment has been minimized.

Contributor

randall77 commented Oct 7, 2014

Comment 1:

So if we're allocating scalars sometimes in the data word and sometimes pointed to by
the data word, then users of the interface need to distinguish those cases.  So, for
example, assertI2T for scalars must check if the result looks like a pointer into the
heap and of so, dereference it.
@dvyukov

This comment has been minimized.

Member

dvyukov commented Oct 7, 2014

Comment 2:

Right. If it's not intended to be a pointer but looks like a pointer, dereference it.
@rsc

This comment has been minimized.

Contributor

rsc commented Oct 7, 2014

Comment 3:

I believe we should not do this. It's too clever, and it will come back to bit eus later.

@rsc rsc added this to the Unplanned milestone Apr 10, 2015

@rsc rsc removed release-none labels Apr 10, 2015

@ysmolsky

This comment has been minimized.

Member

ysmolsky commented Nov 6, 2018

@dvyukov, does this issue look relevant to you?

@dvyukov

This comment has been minimized.

Member

dvyukov commented Nov 6, 2018

@ysmolsky I don't understand the question. What do you mean?

@ianlancetaylor

This comment has been minimized.

Contributor

ianlancetaylor commented Nov 6, 2018

@dvyukov I think he is asking whether you think this issue should still be open.

Really this is a question for @aclements and @RLH. Is this a feasible optimization with the current GC?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment