The Go compiler is not very good at eliminating redundant copies of large 
temporaries (structs with many fields, or arrays with length>1).

On Tuesday, July 13, 2021 at 2:51:32 PM UTC-7 buro...@gmail.com wrote:

> https://go.godbolt.org/z/G8K79K48G - small
> https://go.godbolt.org/z/Yv853E6P3 - long
>
> >go version go1.16 windows/amd64
>
> On the local machine i am executing  go tool compile -S main.go > main.s
>
> in the second case, I see that the compiler sees here a local variable 
> entering the code. Why is this happening ? why is such a different code 
> generated?
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/8e2c63e4-6d90-433c-bf36-b8c84dec5fc9n%40googlegroups.com.

Reply via email to