cmd/compile: unnecessary runtime.growslice with provable capacity #66692
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
Go version
go1.22
Output of
go env
in your module/workspace:What did you do?
Compile the following:
What did you see happen?
I see the following in the assembly:
What did you expect to see?
No call to
runtime.growslice
.This particular example seems silly, but the capacity check already happens elsewhere in code beforehand so there is no possible way that
growslice
would be necessary once we get toAppendUint64
.The text was updated successfully, but these errors were encountered: