BenchmarkGetHostIndexByte-8 100000000 25.1 ns/op
BenchmarkGetHostSplitHostPort-8 30000000 58.0 ns/op
BenchmarkGetHostIndexLoop-8 200000000 9.21 ns/op
BenchmarkGetHostRangeLoop-8 30000000 53.1 ns/op
b.ReportAllocs()
-gcflags=-m
-cpuprofile
Will be useful here
BenchmarkGetHostIndexByte-8 50000000 25.4 ns/op 0 B/op 0 allocs/op
BenchmarkGetHostSplitHostPort-8 30000000 58.5 ns/op 0 B/op 0 allocs/op
BenchmarkGetHostIndexLoop-8 200000000 8.59 ns/op 0 B/op 0 allocs/op
BenchmarkGetHostRangeLoop-8 30000000 52.2 ns/op 0 B/op 0 allocs/op
Here's the output from gcflags=-m,
./hostport_test.go:14: leaking param: hostPort
./hostport_test.go:21: leaking param: hostPort
./hostport_test.go:30: leaking param: hostPort to result ~r1 level=0
./hostport_test.go:30: leaking param: hostPort to result ~r1 level=0
./hostport_test.go:41: leaking param: hostPort to result ~r1 level=0
./hostport_test.go:41: leaking param: hostPort to result ~r1 level=0
./hostport_test.go:56: host escapes to heap
./hostport_test.go:50: BenchmarkGetHostIndexByte b does not escape
./hostport_test.go:56: BenchmarkGetHostIndexByte ... argument does not escape
./hostport_test.go:66: host escapes to heap
./hostport_test.go:60: BenchmarkGetHostSplitHostPort b does not escape
./hostport_test.go:66: BenchmarkGetHostSplitHostPort ... argument does not escape
./hostport_test.go:76: host escapes to heap
./hostport_test.go:70: BenchmarkGetHostIndexLoop b does not escape
./hostport_test.go:76: BenchmarkGetHostIndexLoop ... argument does not escape
./hostport_test.go:86: host escapes to heap
./hostport_test.go:80: BenchmarkGetHostRangeLoop b does not escape
./hostport_test.go:86: BenchmarkGetHostRangeLoop ... argument does not escape
enchmarkGetHostIndexByte-8 100000000 23.7 ns/op
BenchmarkGetHostSplitHostPort-8 20000000 99.0 ns/op
BenchmarkGetHostIndexLoop-8 100000000 12.4 ns/op
BenchmarkGetHostRangeLoop-8 30000000 47.0 ns/op
BenchmarkGetHostIndexByte-8 200000000 7.01 ns/op
BenchmarkGetHostSplitHostPort-8 20000000 65.9 ns/op
BenchmarkGetHostIndexLoop-8 100000000 14.0 ns/op
BenchmarkGetHostRangeLoop-8 30000000 43.2 ns/op
BenchmarkGetHostIndexByte-8 50000000 24.9 ns/op
BenchmarkGetHostSplitHostPort-8 100000000 25.1 ns/op
BenchmarkGetHostIndexLoop-8 50000000 25.0 ns/op
BenchmarkGetHostRangeLoop-8 50000000 25.3 ns/op
BenchmarkGetHostIndexByte-8 200000000 6.57 ns/op
BenchmarkGetHostSplitHostPort-8 200000000 6.22 ns/op
BenchmarkGetHostIndexLoop-8 300000000 6.59 ns/op
BenchmarkGetHostRangeLoop-8 200000000 6.13 ns/op
--
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...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I'm happy to file a bug.