MCPcopy Create free account
hub / github.com/Shopify/goose / BenchmarkReadString

Function BenchmarkReadString

syncio/buffer_test.go:459–472  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

457}
458
459func BenchmarkReadString(b *testing.B) {
460 const n = 32 << 10
461
462 data := make([]byte, n)
463 data[n-1] = 'x'
464 b.SetBytes(int64(n))
465 for i := 0; i < b.N; i++ {
466 buf := NewBuffer(data)
467 _, err := buf.ReadString('x')
468 if err != nil {
469 b.Fatal(err)
470 }
471 }
472}
473
474func TestGrow(t *testing.T) {
475 x := []byte{'x'}

Callers

nothing calls this directly

Calls 2

ReadStringMethod · 0.95
NewBufferFunction · 0.85

Tested by

no test coverage detected