MCPcopy Create free account
hub / github.com/apache/thrift / generateSafeReadBytesBenchmark

Function generateSafeReadBytesBenchmark

lib/go/thrift/binary_protocol_test.go:119–127  ·  view source on GitHub ↗
(askedSize int32, dataSize int)

Source from the content-addressed store, hash-verified

117}
118
119func generateSafeReadBytesBenchmark(askedSize int32, dataSize int) func(b *testing.B) {
120 return func(b *testing.B) {
121 data := make([]byte, dataSize)
122 b.ResetTimer()
123 for range b.N {
124 safeReadBytes(askedSize, bytes.NewReader(data))
125 }
126 }
127}
128
129func TestSafeReadBytesAlloc(t *testing.T) {
130 if testing.Short() {

Callers 2

TestSafeReadBytesAllocFunction · 0.85
BenchmarkSafeReadBytesFunction · 0.85

Calls 1

safeReadBytesFunction · 0.85

Tested by

no test coverage detected