MCPcopy Index your code
hub / github.com/CodisLabs/codis / benchmarkConn

Function benchmarkConn

pkg/proxy/redis/conn_test.go:40–46  ·  view source on GitHub ↗
(b *testing.B, n int)

Source from the content-addressed store, hash-verified

38}
39
40func benchmarkConn(b *testing.B, n int) {
41 unsafe2.SetMaxOffheapBytes(0)
42 for i := 0; i < b.N; i++ {
43 c := NewConn(&net.TCPConn{}, n, n)
44 c.Close()
45 }
46}
47
48func benchmarkConnOffheap(b *testing.B, n int) {
49 unsafe2.SetMaxOffheapBytes(1024 * 1024 * 512)

Callers 5

BenchmarkConn16KFunction · 0.85
BenchmarkConn32KFunction · 0.85
BenchmarkConn64KFunction · 0.85
BenchmarkConn128KFunction · 0.85
BenchmarkConn256KFunction · 0.85

Calls 2

CloseMethod · 0.95
NewConnFunction · 0.70

Tested by

no test coverage detected