-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: devirtualization of interface calls with type assertions #64824
Comments
It seems to me that |
This is the whole point of of devirtualization. Same |
This seems doable for Go 1.23. Did this come up in real world code though? For example, |
Only the first example, but this is not performance related in my case, I just was curious why the hash escaped and it turned out to this. |
Support for this would influence API design in #69521 (comment). |
Change https://go.dev/cl/649195 mentions this issue: |
Change https://go.dev/cl/652036 mentions this issue: |
Consider:
https://go.dev/play/p/JYPsrebi5Z5
h
escapes to heap, because the compiler does not take the opportunity to devirtualize theUnmarshalBinary
call.Same thing happens with even a simpler case (
hash.Hash
always implementsio.Writer
)The text was updated successfully, but these errors were encountered: