cmd/compile: Optimize three-way string comparisons #31187
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
As shown in
strings.Compare
's source code, three-way string comparisons can be optimized.A few use cases are:
For the last use case my benchmark showed a over 10% improvement by using
bytes.Compare
instaed ofstrings.Compare
.The text was updated successfully, but these errors were encountered: