1 package pq 2 3 import "testing" 4 5 func Benchmark_writeBuf_string(b *testing.B) { 6 var buf writeBuf 7 const s = "foo" 8 9 b.ReportAllocs() 10 b.ResetTimer() 11 12 for i := 0; i < b.N; i++ { 13 buf.string(s) 14 buf.buf = buf.buf[:0] 15 } 16 } 17
View as plain text