MCPcopy
hub / github.com/openacid/slim / BenchmarkBaseGet

Function BenchmarkBaseGet

array/base_test.go:276–294  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

274var OutputBool bool
275
276func BenchmarkBaseGet(b *testing.B) {
277
278 indexes := []int32{1, 3, 100}
279 elts := []uint16{1, 3, 100}
280
281 ab := &array.Base{}
282 err := ab.Init(indexes, elts)
283 if err != nil {
284 panic(err)
285 }
286
287 ab.EltEncoder = encode.U16{}
288
289 b.ResetTimer()
290
291 for i := 0; i < b.N; i++ {
292 ab.Get(1)
293 }
294}
295
296func BenchmarkBaseGetBytes(b *testing.B) {
297

Callers

nothing calls this directly

Calls 2

InitMethod · 0.95
GetMethod · 0.95

Tested by

no test coverage detected