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

Function benchmarkDecode

pkg/proxy/redis/decoder_test.go:139–146  ·  view source on GitHub ↗
(b *testing.B, n int)

Source from the content-addressed store, hash-verified

137}
138
139func benchmarkDecode(b *testing.B, n int) {
140 d := newBenchmarkDecoder(n)
141 for i := 0; i < b.N; i++ {
142 multi, err := d.DecodeMultiBulk()
143 assert.MustNoError(err)
144 assert.Must(len(multi) == 1 && len(multi[0].Value) == n)
145 }
146}
147
148func BenchmarkDecode16B(b *testing.B) { benchmarkDecode(b, 16) }
149func BenchmarkDecode64B(b *testing.B) { benchmarkDecode(b, 64) }

Callers 9

BenchmarkDecode16BFunction · 0.85
BenchmarkDecode64BFunction · 0.85
BenchmarkDecode512BFunction · 0.85
BenchmarkDecode1KFunction · 0.85
BenchmarkDecode2KFunction · 0.85
BenchmarkDecode4KFunction · 0.85
BenchmarkDecode16KFunction · 0.85
BenchmarkDecode32KFunction · 0.85
BenchmarkDecode128KFunction · 0.85

Calls 2

newBenchmarkDecoderFunction · 0.85
DecodeMultiBulkMethod · 0.80

Tested by

no test coverage detected