Skip to content
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

cmd/compile: unnecessary calls to convT2E #14250

Closed
randall77 opened this issue Feb 7, 2016 · 1 comment
Closed

cmd/compile: unnecessary calls to convT2E #14250

randall77 opened this issue Feb 7, 2016 · 1 comment

Comments

@randall77
Copy link
Contributor

If the type T is a direct interface type (a pointer type), we don't need to call into the runtime to convert a value from type T to an interface{}. If T is such a type, then just making an interface value from the type ptr (a constant) and T itself is all that is needed.

For convT2I, we could also do something similar. If the type is a directInterface type and the itab cache is not nil, we can use that itab cache value directly without calling into the runtime. This is less obviously a win because the generated code still needs the call, and the cache read might need an atomic load.

@randall77 randall77 added this to the Go1.7 milestone Feb 7, 2016
@randall77
Copy link
Contributor Author

Michel fixed this by inlining convT2{I,E} when T is a direct interface type.

@golang golang locked and limited conversation to collaborators Apr 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants