MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / BenchmarkBufferPool

Function BenchmarkBufferPool

pkg/sql/tokenizer/tokenizer_bench_test.go:101–116  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

99}
100
101func BenchmarkBufferPool(b *testing.B) {
102 b.Run("GetPut", func(b *testing.B) {
103 for i := 0; i < b.N; i++ {
104 buf := getBuffer()
105 putBuffer(buf)
106 }
107 })
108
109 b.Run("WithWrite", func(b *testing.B) {
110 for i := 0; i < b.N; i++ {
111 buf := getBuffer()
112 buf.WriteString("test string with some content")
113 putBuffer(buf)
114 }
115 })
116}
117
118// Benchmark memory allocations
119func BenchmarkTokenizerAllocations(b *testing.B) {

Callers

nothing calls this directly

Calls 3

getBufferFunction · 0.85
putBufferFunction · 0.85
RunMethod · 0.80

Tested by

no test coverage detected