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

Function BenchmarkScanner_CleanSQL

pkg/sql/security/scanner_bench_test.go:44–56  ·  view source on GitHub ↗

BenchmarkScanner_CleanSQL benchmarks scanning clean SQL

(b *testing.B)

Source from the content-addressed store, hash-verified

42
43// BenchmarkScanner_CleanSQL benchmarks scanning clean SQL
44func BenchmarkScanner_CleanSQL(b *testing.B) {
45 sql := "SELECT id, name, email FROM users WHERE active = true ORDER BY created_at DESC"
46 scanner := NewScanner()
47
48 tree := parseSQL(b, sql)
49 defer ast.ReleaseAST(tree)
50
51 b.ReportAllocs()
52 b.ResetTimer()
53 for i := 0; i < b.N; i++ {
54 scanner.Scan(tree)
55 }
56}
57
58// BenchmarkScanner_CleanSQL_Raw benchmarks scanning raw SQL string
59func BenchmarkScanner_CleanSQL_Raw(b *testing.B) {

Callers

nothing calls this directly

Calls 4

ScanMethod · 0.95
ReleaseASTFunction · 0.92
NewScannerFunction · 0.85
parseSQLFunction · 0.70

Tested by

no test coverage detected