go/types: don't build errors in AssignableTo, ConvertibleTo #54172
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Performance
Milestone
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
andtypes.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
The text was updated successfully, but these errors were encountered: