On Sun, Mar 1, 2020 at 5:56 AM Jason E. Aten wrote:
>
> escape analysis is eliminating the allocation in the simplification. in
> reality the slice is stored in a persistent struct.
Can you show us a complete example program? It's possible that the
allocation is getting attributed to the wrong
escape analysis is eliminating the allocation in the simplification. in
reality the slice is stored in a persistent struct.
On Sun, Mar 1, 2020 at 8:50 AM wrote:
> Jason,
>
> Your example does not appear to support your claim.
>
> A benchmark:
>
> package main
>
> import (
> "strconv"
>
Jason,
Your example does not appear to support your claim.
A benchmark:
package main
import (
"strconv"
"testing"
)
type A struct {
B string
}
func mycode(slice []A) {
slice = slice[1:]
}
func BenchmarkMycode(b *testing.B) {
a := make([]A, 256)
for i := range a {