http://go-talks.appspot.com/github.com/davecheney/presentations/writing-high-performance-go.slide#30
the above slide says "the conversion of the byte slice to a string" in the following case will no copy the underlining byte array. > var m = map[string]string{} > v, ok := m[string(bytes)] > > If "bytes" is a local variable, it is reasonable the compiler will do the optimization. But how about if "bytes" is a global variable? -- 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. For more options, visit https://groups.google.com/d/optout.