Skip to content

x/tools/go/types/objectpath: remove sorting of Named type methods #61443

Closed
@findleyr

Description

@findleyr

As we've seen in #58668 (comment), the sorting of Named type methods can dominate the cost of using the objectpath package. In the example there, both gopls and the staticcheck analysis driver are essentially unusable when Named type methods are sorted.

Proposal: We propose to remove this sorting, effectively reverting the fix for #44195. We should instead guarantee in our documentation that the order of methods is deterministic, both the compiler and go/types agree on this sorting, and this sorting is preserved by all importers/exporters.

(Aside: I'm going to remove the sorting (conditionally) in gopls now, because this has a large impact on gopls usability. However, whatever back-channels I use to do so should be short-lived, and we should agree on a path forward that works for everyone.)

CC @adonovan @dominikh @griesemer @mdempsky

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions