BenchmarkIntegration_RealWorldScenarios benchmarks real-world query scenarios
(b *testing.B)
| 484 | |
| 485 | // BenchmarkIntegration_RealWorldScenarios benchmarks real-world query scenarios |
| 486 | func BenchmarkIntegration_RealWorldScenarios(b *testing.B) { |
| 487 | projectRoot, _ := filepath.Abs(filepath.Join("..", "..")) |
| 488 | files := loadSQLTestFiles(&testing.T{}, projectRoot) |
| 489 | |
| 490 | realWorldFiles := []SQLTestFile{} |
| 491 | for _, file := range files { |
| 492 | if file.Dialect == "real_world" { |
| 493 | realWorldFiles = append(realWorldFiles, file) |
| 494 | } |
| 495 | } |
| 496 | |
| 497 | if len(realWorldFiles) == 0 { |
| 498 | b.Skip("No real-world test files found") |
| 499 | } |
| 500 | |
| 501 | b.ResetTimer() |
| 502 | for i := 0; i < b.N; i++ { |
| 503 | for _, file := range realWorldFiles { |
| 504 | sqlStatement := extractSQLStatement(file.Content) |
| 505 | tkz := tokenizer.GetTokenizer() |
| 506 | tokens, _ := tkz.Tokenize([]byte(sqlStatement)) |
| 507 | |
| 508 | tokenizer.PutTokenizer(tkz) |
| 509 | |
| 510 | p := parser.NewParser() |
| 511 | _, _ = p.ParseFromModelTokens(tokens) |
| 512 | p.Release() |
| 513 | } |
| 514 | } |
| 515 | } |
nothing calls this directly
no test coverage detected