MCPcopy Create free account
hub / github.com/brimdata/super / BenchmarkReadBSUP

Function BenchmarkReadBSUP

vector/vector_test.go:46–65  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

44const N = 10000000
45
46func BenchmarkReadBSUP(b *testing.B) {
47 rand := rand.New(rand.NewSource(42))
48 valuesIn := make([]super.Value, N)
49 for i := range valuesIn {
50 valuesIn[i] = super.NewInt64(rand.Int63n(N))
51 }
52 var buf bytes.Buffer
53 fuzz.WriteBSUP(b, valuesIn, &buf)
54 bs := buf.Bytes()
55
56 for b.Loop() {
57 valuesOut, err := fuzz.ReadBSUP(bs)
58 if err != nil {
59 panic(err)
60 }
61 if super.DecodeInt(valuesIn[N-1].Bytes()) != super.DecodeInt(valuesOut[N-1].Bytes()) {
62 panic("oh no")
63 }
64 }
65}
66
67func BenchmarkReadCSUP(b *testing.B) {
68 rand := rand.New(rand.NewSource(42))

Callers

nothing calls this directly

Calls 6

NewInt64Function · 0.92
WriteBSUPFunction · 0.92
ReadBSUPFunction · 0.92
DecodeIntFunction · 0.92
NewMethod · 0.80
BytesMethod · 0.45

Tested by

no test coverage detected