BenchmarkScanner_Parallel benchmarks concurrent scanning
(b *testing.B)
| 201 | |
| 202 | // BenchmarkScanner_Parallel benchmarks concurrent scanning |
| 203 | func 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 |
| 220 | func BenchmarkScanner_ParallelRawSQL(b *testing.B) { |
nothing calls this directly
no test coverage detected