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

Function BenchmarkParseBytes

pkg/sql/parser/validate_test.go:111–120  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

109}
110
111func BenchmarkParseBytes(b *testing.B) {
112 sql := []byte("SELECT u.id, u.name, u.email FROM users u JOIN orders o ON u.id = o.user_id WHERE u.active = true AND o.total > 100 ORDER BY o.created_at DESC LIMIT 50")
113 b.ResetTimer()
114 for i := 0; i < b.N; i++ {
115 result, err := parser.ParseBytes(sql)
116 if err == nil {
117 ast.ReleaseAST(result)
118 }
119 }
120}
121
122func BenchmarkValidateLargeSQL(b *testing.B) {
123 // Build a large SQL query

Callers

nothing calls this directly

Calls 2

ParseBytesFunction · 0.92
ReleaseASTFunction · 0.92

Tested by

no test coverage detected