File: buf_test.go

package info (click to toggle)
golang-github-lib-pq 1.10.9-2
  • links: PTS, VCS
  • area: main
  • in suites: experimental, sid, trixie
  • size: 724 kB
  • sloc: makefile: 35; sh: 14
file content (16 lines) | stat: -rw-r--r-- 221 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package pq

import "testing"

func Benchmark_writeBuf_string(b *testing.B) {
	var buf writeBuf
	const s = "foo"

	b.ReportAllocs()
	b.ResetTimer()

	for i := 0; i < b.N; i++ {
		buf.string(s)
		buf.buf = buf.buf[:0]
	}
}