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

Function benchmarkEncode

pkg/proxy/redis/encoder_test.go:90–99  ·  view source on GitHub ↗
(b *testing.B, n int)

Source from the content-addressed store, hash-verified

88}
89
90func benchmarkEncode(b *testing.B, n int) {
91 multi := []*Resp{
92 NewBulkBytes(make([]byte, n)),
93 }
94 e := newBenchmarkEncoder(n)
95 for i := 0; i < b.N; i++ {
96 assert.MustNoError(e.EncodeMultiBulk(multi, false))
97 }
98 assert.MustNoError(e.Flush())
99}
100
101func BenchmarkEncode16B(b *testing.B) { benchmarkEncode(b, 16) }
102func BenchmarkEncode64B(b *testing.B) { benchmarkEncode(b, 64) }

Callers 9

BenchmarkEncode16BFunction · 0.85
BenchmarkEncode64BFunction · 0.85
BenchmarkEncode512BFunction · 0.85
BenchmarkEncode1KFunction · 0.85
BenchmarkEncode2KFunction · 0.85
BenchmarkEncode4KFunction · 0.85
BenchmarkEncode16KFunction · 0.85
BenchmarkEncode32KFunction · 0.85
BenchmarkEncode128KFunction · 0.85

Calls 4

NewBulkBytesFunction · 0.85
newBenchmarkEncoderFunction · 0.85
EncodeMultiBulkMethod · 0.45
FlushMethod · 0.45

Tested by

no test coverage detected