MCPcopy Create free account
hub / github.com/apache/fory / BenchmarkWriteVarUint64Loop

Function BenchmarkWriteVarUint64Loop

go/fory/buffer_bench_test.go:166–175  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

164}
165
166func BenchmarkWriteVarUint64Loop(b *testing.B) {
167 buf := NewByteBuffer(make([]byte, 0, 1024))
168 values := benchVarUint64Values
169 b.ReportAllocs()
170 b.ResetTimer()
171 for i := 0; i < b.N; i++ {
172 buf.writerIndex = 0
173 buf.WriteVarUint64(values[i%len(values)])
174 }
175}
176
177func BenchmarkWriteVarUint64LoopSmall(b *testing.B) {
178 buf := NewByteBuffer(make([]byte, 0, 1024))

Callers

nothing calls this directly

Calls 2

WriteVarUint64Method · 0.95
NewByteBufferFunction · 0.85

Tested by

no test coverage detected