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

Function BenchmarkBufferNotEmptyWriteRead

syncio/buffer_test.go:618–628  ·  view source on GitHub ↗

From Issue 5154.

(b *testing.B)

Source from the content-addressed store, hash-verified

616
617// From Issue 5154.
618func BenchmarkBufferNotEmptyWriteRead(b *testing.B) {
619 buf := make([]byte, 1024)
620 for i := 0; i < b.N; i++ {
621 var b Buffer
622 b.Write(buf[0:1])
623 for i := 0; i < 5<<10; i++ {
624 b.Write(buf)
625 b.Read(buf)
626 }
627 }
628}
629
630// Check that we don't compact too often. From Issue 5154.
631func BenchmarkBufferFullSmallReads(b *testing.B) {

Callers

nothing calls this directly

Calls 2

WriteMethod · 0.95
ReadMethod · 0.95

Tested by

no test coverage detected