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

Function BenchmarkWriteVarUint64LoopSmall

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

Source from the content-addressed store, hash-verified

175}
176
177func BenchmarkWriteVarUint64LoopSmall(b *testing.B) {
178 buf := NewByteBuffer(make([]byte, 0, 1024))
179 values := benchVarUint64SmallValues
180 b.ReportAllocs()
181 b.ResetTimer()
182 for i := 0; i < b.N; i++ {
183 buf.writerIndex = 0
184 buf.WriteVarUint64(values[i%len(values)])
185 }
186}
187
188func BenchmarkWriteVarUint64LoopMid(b *testing.B) {
189 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