cmd/compile: struct equality code optimization #39428
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Performance
Milestone
The array equality function looks optimal. It compares each length in turn and branches to "return false" if any don't match. If all the lengths match, then it calls
memequal
in a loop for each string.The code for struct equality looks worse.
The length-same (calling memequal) and length-different branches recombine, requiring retesting of the result, which then skips over the remaining tests (and not all the rest, but one at a time).
@josharian
The text was updated successfully, but these errors were encountered: