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

Function BenchmarkWriteByte

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

Source from the content-addressed store, hash-verified

590}
591
592func BenchmarkWriteByte(b *testing.B) {
593 const n = 4 << 10
594 b.SetBytes(n)
595 buf := NewBuffer(make([]byte, n))
596 for i := 0; i < b.N; i++ {
597 buf.Reset()
598 for i := 0; i < n; i++ {
599 buf.WriteByte('x')
600 }
601 }
602}
603
604func BenchmarkWriteRune(b *testing.B) {
605 const n = 4 << 10

Callers

nothing calls this directly

Calls 3

ResetMethod · 0.95
WriteByteMethod · 0.95
NewBufferFunction · 0.85

Tested by

no test coverage detected