reflect, cmd/compile: TypeOf(a) == TypeOf(b) doesn't optimize well #65524
Labels
compiler/runtime
Issues related to the Go compiler and/or runtime.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
reflect.TypeOf(a) == reflect.TypeOf(b)
should optimize to a simple comparison of the type pointers stored in the interface value (or in the itab ifa
andb
aren'tany
)Currently, the code compiles more naively: it's constructing new interface values with
*rtype
s stored in them, to then callifaceeq
.@josharian offered the following analysis on Slack:
The text was updated successfully, but these errors were encountered: