cmd/compile: optimize append with string concatenation #56442
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
Consider the following benchmark:
There's a number of string concatenations going on, some from variables and others from constants,
which runs in:
However, the benchmark is semantically equivalent to:
which runs in:
That is a 100% reduction in allocations, and a dramatic speedup.
The compiler should implicitly perform this transformation for me.
The text was updated successfully, but these errors were encountered: