[go-nuts] about golang escape analysis

2017-12-03 Thread Dave Cheney
Add -gcflags=“-m -m” will tell you. -- 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

[go-nuts] about golang escape analysis

2017-12-02 Thread 刘桂祥
package main import "testing" var gbuf []byte var gi int func BenchmarkCopy1(b *testing.B) { b.ReportAllocs() for i := 0; i < b.N; i++ { m := make(map[string]int, 5) for i := 0; i < 5; i++ { m["100"] = i } for key := range m { copyIface1(key, key) } } } func BenchmarkCopy2(b *testing.B) {