You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
seankhliao
changed the title
runtime: redundant allocation & copy in return string([]byte)
cmd/compile: redundant allocation & copy in return string([]byte)
Mar 25, 2022
What version of Go are you using (
go version
)?go1.17.8
Does this issue reproduce with the latest release?
yes also with
go1.18
What operating system and processor architecture are you using (
go env
)?x86_64 Linux
What did you do?
pkg.go
pkg_test.go
go test -v -bench ToLower -benchmem -count=3
printsWhat did you expect to see?
I was expecting to see a single memory allocation in
ToLower()
since there is no other reference tobuf
.What did you see instead?
As is clear in bench output, there must a redundant allocation & copy in
return string(buf)
.The text was updated successfully, but these errors were encountered: