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

Function BenchmarkScanner_Parallel

pkg/sql/security/scanner_bench_test.go:203–217  ·  view source on GitHub ↗

BenchmarkScanner_Parallel benchmarks concurrent scanning

(b *testing.B)

Source from the content-addressed store, hash-verified

201
202// BenchmarkScanner_Parallel benchmarks concurrent scanning
203func BenchmarkScanner_Parallel(b *testing.B) {
204 sql := "SELECT * FROM users WHERE id = 1 OR 1=1"
205
206 tree := parseSQL(b, sql)
207 defer ast.ReleaseAST(tree)
208
209 b.ReportAllocs()
210 b.ResetTimer()
211 b.RunParallel(func(pb *testing.PB) {
212 scanner := NewScanner()
213 for pb.Next() {
214 scanner.Scan(tree)
215 }
216 })
217}
218
219// BenchmarkScanner_ParallelRawSQL benchmarks concurrent raw SQL scanning
220func BenchmarkScanner_ParallelRawSQL(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