MCPcopy
hub / github.com/tinylib/msgp / BenchmarkReadFloat64

Function BenchmarkReadFloat64

msgp/read_test.go:363–379  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

361}
362
363func BenchmarkReadFloat64(b *testing.B) {
364 fs := []float64{rand.Float64(), rand.Float64(), rand.Float64(), rand.Float64()}
365 data := make([]byte, 0, 9*len(fs))
366 for _, f := range fs {
367 data = AppendFloat64(data, f)
368 }
369 rd := NewReader(NewEndlessReader(data, b))
370 b.SetBytes(9)
371 b.ReportAllocs()
372 b.ResetTimer()
373 for i := 0; i < b.N; i++ {
374 _, err := rd.ReadFloat64()
375 if err != nil {
376 b.Fatal(err)
377 }
378 }
379}
380
381func TestReadFloat32(t *testing.T) {
382 var buf bytes.Buffer

Callers

nothing calls this directly

Calls 4

ReadFloat64Method · 0.95
AppendFloat64Function · 0.85
NewReaderFunction · 0.85
NewEndlessReaderFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…