MCPcopy
hub / github.com/grafana/tempo / BenchmarkGeneratorDecoderPushBytes

Function BenchmarkGeneratorDecoderPushBytes

pkg/ingest/encoding_test.go:210–225  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

208}
209
210func BenchmarkGeneratorDecoderPushBytes(b *testing.B) {
211 stream := generateRequest(1000, 200)
212 traceBytes, err := stream.Marshal()
213 require.NoError(b, err)
214
215 b.ReportAllocs()
216 decoder := NewPushBytesDecoder()
217
218 b.ResetTimer()
219 for b.Loop() {
220 iterator, err := decoder.Decode(traceBytes)
221 require.NoError(b, err)
222 for range iterator { // nolint:revive // we want to run the side effects of ranging itself
223 }
224 }
225}
226
227// Original implementation without clear() for comparison
228func encoderPoolPutOriginal(req *tempopb.PushBytesRequest) {

Callers

nothing calls this directly

Calls 5

DecodeMethod · 0.95
generateRequestFunction · 0.85
NewPushBytesDecoderFunction · 0.85
LoopMethod · 0.80
MarshalMethod · 0.65

Tested by

no test coverage detected