MCPcopy Create free account
hub / github.com/chain/Core / BenchmarkReadVarint31

Function BenchmarkReadVarint31

encoding/blockchain/blockchain_test.go:15–22  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

13)
14
15func BenchmarkReadVarint31(b *testing.B) {
16 data := []byte{0xff, 0xff, 0xff, 0xff, 0x01}
17 r := NewReader(data)
18 for i := 0; i < b.N; i++ {
19 r.buf = data
20 ReadVarint31(r)
21 }
22}
23
24func BenchmarkReadVarint63(b *testing.B) {
25 data := []byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01}

Callers

nothing calls this directly

Calls 2

NewReaderFunction · 0.85
ReadVarint31Function · 0.85

Tested by

no test coverage detected