perf: SQLite3 comparison benchmark and report#18
Conversation
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis change introduces a SQLite3 benchmarking framework to compare cloudSQL's performance against SQLite. It includes CMake integration for fetching and building SQLite3, a new benchmark file with four comparison tests (point inserts and sequential scans), and documentation detailing the performance comparison results and identified optimization opportunities. Changes
Sequence Diagram(s)sequenceDiagram
participant Benchmark as Google Benchmark
participant CloudCtx as CloudSQLContext
participant CloudEng as CloudSQL Engine
participant SQLiteCtx as SQLiteContext
participant SQLite as SQLite3
Note over Benchmark: Insert Benchmark
Benchmark->>CloudCtx: Initialize (create table)
CloudCtx->>CloudEng: Create storage, catalog, managers
CloudEng-->>CloudCtx: Ready
loop Each iteration
Benchmark->>CloudEng: Parse & execute INSERT
CloudEng-->>Benchmark: Row inserted
end
Benchmark->>SQLiteCtx: Initialize (create table)
SQLiteCtx->>SQLite: Open DB, apply PRAGMAs
SQLite-->>SQLiteCtx: Ready
loop Each iteration
Benchmark->>SQLite: Step prepared INSERT
SQLite-->>Benchmark: Row inserted
end
sequenceDiagram
participant Benchmark as Google Benchmark
participant CloudCtx as CloudSQLContext
participant CloudEng as CloudSQL Engine
participant QueryExec as QueryExecutor
participant SQLiteCtx as SQLiteContext
participant SQLite as SQLite3
Note over Benchmark: Scan Benchmark
Benchmark->>CloudCtx: Initialize & populate
CloudCtx->>CloudEng: Insert num_rows via executor
CloudEng-->>CloudCtx: Population complete
loop Each iteration
Benchmark->>QueryExec: Execute prepared SELECT \\*
QueryExec->>CloudEng: Scan table
CloudEng-->>QueryExec: Return rows
QueryExec-->>Benchmark: All rows processed
end
Benchmark->>SQLiteCtx: Initialize & populate
SQLiteCtx->>SQLite: Bulk INSERT in transaction
SQLite-->>SQLiteCtx: Population complete
loop Each iteration
Benchmark->>SQLite: Step through SELECT \\* results
SQLite-->>Benchmark: Each row
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This PR adds a dedicated benchmarking suite to compare cloudSQL against SQLite3.
Key Additions:
FetchContent.Results (Release Mode):
This establishes a clear industry-standard baseline for our future optimization efforts.
Summary by CodeRabbit
Release Notes
New Features
Documentation