(b *testing.B)
| 590 | } |
| 591 | |
| 592 | func 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 | |
| 604 | func BenchmarkWriteRune(b *testing.B) { |
| 605 | const n = 4 << 10 |