Skip to content

Instantly share code, notes, and snippets.

@Mistobaan
Created April 25, 2015 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mistobaan/a0272ad53497f8ecfab8 to your computer and use it in GitHub Desktop.
Save Mistobaan/a0272ad53497f8ecfab8 to your computer and use it in GitHub Desktop.
# _/Users/fabrizio/workspace/stackoverflow
./struct_test.go:19: &Country literal escapes to heap
./struct_test.go:13: BenchmarkMapPointer b does not escape
./struct_test.go:15: BenchmarkMapPointer make(map[string]*Country, 0) does not escape
./struct_test.go:32: BenchmarkMapNoPointer b does not escape
./struct_test.go:34: BenchmarkMapNoPointer make(map[string]Country, 0) does not escape
./struct_test.go:63: &BigCountry literal escapes to heap
./struct_test.go:57: BenchmarkMapBigStructPointer b does not escape
./struct_test.go:59: BenchmarkMapBigStructPointer make(map[string]*BigCountry, 0) does not escape
./struct_test.go:76: BenchmarkMapBigStructNoPointer b does not escape
./struct_test.go:78: BenchmarkMapBigStructNoPointer make(map[string]BigCountry, 0) does not escape
# testmain
/var/folders/kk/bvdzsrrs0ygd8jjf2zqddc280000gn/T/go-build987100297/_/Users/fabrizio/workspace/stackoverflow/_test/_testmain.go:56: inlining call to testing.MainStart
/var/folders/kk/bvdzsrrs0ygd8jjf2zqddc280000gn/T/go-build987100297/_/Users/fabrizio/workspace/stackoverflow/_test/_testmain.go:41: leaking param: pat
/var/folders/kk/bvdzsrrs0ygd8jjf2zqddc280000gn/T/go-build987100297/_/Users/fabrizio/workspace/stackoverflow/_test/_testmain.go:41: leaking param: str
/var/folders/kk/bvdzsrrs0ygd8jjf2zqddc280000gn/T/go-build987100297/_/Users/fabrizio/workspace/stackoverflow/_test/_testmain.go:56: &testing.M literal escapes to heap
testing: warning: no tests to run
PASS
BenchmarkMapPointer 5000 262440 ns/op 39893 B/op 3002 allocs/op
BenchmarkMapNoPointer 10000 141414 ns/op 7864 B/op 2001 allocs/op
BenchmarkMapBigStructPointer 500 3763944 ns/op 1158194 B/op 3002 allocs/op
BenchmarkMapBigStructNoPointer 5000 268620 ns/op 7678 B/op 2001 allocs/op
ok _/Users/fabrizio/workspace/stackoverflow 6.404s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment