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

Function BenchmarkBufferFullSmallReads

syncio/buffer_test.go:631–644  ·  view source on GitHub ↗

Check that we don't compact too often. From Issue 5154.

(b *testing.B)

Source from the content-addressed store, hash-verified

629
630// Check that we don't compact too often. From Issue 5154.
631func BenchmarkBufferFullSmallReads(b *testing.B) {
632 buf := make([]byte, 1024)
633 for i := 0; i < b.N; i++ {
634 var b Buffer
635 b.Write(buf)
636 for b.Len()+20 < b.Cap() {
637 b.Write(buf[:10])
638 }
639 for i := 0; i < 5<<10; i++ {
640 b.Read(buf[:1])
641 b.Write(buf[:1])
642 }
643 }
644}

Callers

nothing calls this directly

Calls 4

WriteMethod · 0.95
LenMethod · 0.95
CapMethod · 0.95
ReadMethod · 0.95

Tested by

no test coverage detected