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).
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: