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

Function BenchmarkSelectStatementPool

pkg/sql/ast/ast_bench_test.go:31–45  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

29}
30
31func BenchmarkSelectStatementPool(b *testing.B) {
32 b.Run("GetPutSelectStatement", func(b *testing.B) {
33 b.ReportAllocs()
34 for i := 0; i < b.N; i++ {
35 stmt := GetSelectStatement()
36 stmt.Columns = append(stmt.Columns, &Identifier{Name: "id"})
37 stmt.Where = &BinaryExpression{
38 Left: &Identifier{Name: "id"},
39 Operator: "=",
40 Right: &Identifier{Name: "1"},
41 }
42 PutSelectStatement(stmt)
43 }
44 })
45}
46
47func BenchmarkIdentifierPool(b *testing.B) {
48 b.Run("GetPutIdentifier", func(b *testing.B) {

Callers

nothing calls this directly

Calls 3

GetSelectStatementFunction · 0.85
PutSelectStatementFunction · 0.85
RunMethod · 0.80

Tested by

no test coverage detected