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

go/types: don't build errors in AssignableTo, ConvertibleTo #54172

Open
findleyr opened this issue Aug 1, 2022 · 0 comments
Open

go/types: don't build errors in AssignableTo, ConvertibleTo #54172

findleyr opened this issue Aug 1, 2022 · 0 comments
Labels
NeedsFix Performance
Milestone

Comments

@findleyr
Copy link
Contributor

@findleyr findleyr commented Aug 1, 2022

Discovered while investigating gopls completion performance (#53992).

While doing auto-completion in gopls, around 25% of total CPU time is spent building strings in Checker.implements here, via calls to types.AssignableTo and types.ConvertibleTo. These error strings aren't used in that codepath.

It would be trivial to avoid building error strings that won't be used, following a similar pattern used elsewhere in the type checker (a reason *string argument).

CC @griesemer @adonovan

@findleyr findleyr added this to the Go1.20 milestone Aug 1, 2022
@dmitshur dmitshur added the NeedsFix label Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix Performance
Projects
None yet
Development

No branches or pull requests

2 participants