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

Function BenchmarkWriteRune

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

Source from the content-addressed store, hash-verified

602}
603
604func BenchmarkWriteRune(b *testing.B) {
605 const n = 4 << 10
606 const r = '☺'
607 b.SetBytes(int64(n * utf8.RuneLen(r)))
608 buf := NewBuffer(make([]byte, n*utf8.UTFMax))
609 for i := 0; i < b.N; i++ {
610 buf.Reset()
611 for i := 0; i < n; i++ {
612 buf.WriteRune(r)
613 }
614 }
615}
616
617// From Issue 5154.
618func BenchmarkBufferNotEmptyWriteRead(b *testing.B) {

Callers

nothing calls this directly

Calls 3

ResetMethod · 0.95
WriteRuneMethod · 0.95
NewBufferFunction · 0.85

Tested by

no test coverage detected