Skip to content

Add comprehensive benchmarking suite#47

Open
muk2 wants to merge 2 commits intomainfrom
feature/issue-46-benchmarking
Open

Add comprehensive benchmarking suite#47
muk2 wants to merge 2 commits intomainfrom
feature/issue-46-benchmarking

Conversation

@muk2
Copy link
Owner

@muk2 muk2 commented Feb 20, 2026

Summary

  • Adds criterion-based benchmark suite covering the full SQL processing pipeline
  • Introduces src/lib.rs to expose library API for benchmark access
  • Benchmarks span 13 SQL query categories from simple SELECTs to complex CTEs

Benchmark Groups

Group What it measures
parsing SQL text → AST conversion across 13 query types
compilation AST → SQL text generation
optimization AST transformation passes (redundant nesting removal)
round_trip Full parse → optimize → compile pipeline
multi_statement Parsing 2 and 5 statements in a single input
explain EXPLAIN plan text parsing (small and large plans)

Query Categories Benchmarked

  • Simple SELECT, SELECT with WHERE, JOINs, multi-JOIN (4 tables)
  • Aggregation with GROUP BY/HAVING
  • CTEs (WITH clause, 2 CTEs)
  • Window functions (ROW_NUMBER, AVG, SUM with frames)
  • Subqueries (IN, EXISTS, scalar)
  • UNION ALL (3-way)
  • INSERT, UPDATE, DELETE
  • CASE expressions

How to Run

cargo bench                    # Run all benchmarks
cargo bench -- parsing         # Run only parsing benchmarks
cargo bench -- round_trip      # Run only round-trip benchmarks

Test plan

  • All 225 existing tests pass
  • Benchmarks compile (cargo bench --no-run)
  • cargo build succeeds
  • Library crate properly exposes needed modules

Closes #46

🤖 Generated with Claude Code

muk2 and others added 2 commits February 20, 2026 07:49
Establishes performance testing infrastructure for the SQL processing
pipeline: parsing, AST optimization, compilation, round-trip, and
EXPLAIN plan parsing across 13 query categories from simple SELECTs
to complex CTEs with window functions.

Closes #46

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Run cargo fmt to fix formatting
- Add Default impl for App and ConnectionManager
- Add #[allow(clippy::should_implement_trait)] for QueryHistory::next()
- Add #[allow(ambiguous_glob_reexports)] for SQL_FUNCTIONS re-export

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

# RFC: Comprehensive Benchmarking + Performance Optimization Initiative

1 participant