Yes this is decided at compile time. If you build your program with `-gcflags '-m'` the compiler will print out detailed escape analysis information. Here's more information: http://www.agardner.me/golang/garbage/collection/gc/escape/a...
It's easy enough to profile and benchmark in go, so I would always treat that as the source of truth.