Add experimental SQLite row-stream apply path#250
Draft
adamziel wants to merge 2 commits into
Draft
Conversation
Contributor
Pull pipeline performance —
|
| Stage | PR | trunk | Δ | Status | Details |
|---|---|---|---|---|---|
playground-sqlite-db-pull |
9.56 s | 9.33 s | ⚪ +236 ms (+2.5%) | ✓ | condition=db-pull in PHP.wasm runtime=php.wasm 8.3 wp_mysql_parser=enabled mode=lexer native_lexer=verified native_token_stream=WP_MySQL_Native_Token_Stream native_token_count=18 native_parser=selected trunk: condition=db-pull in PHP.wasm runtime=php.wasm 8.3 wp_mysql_parser=enabled mode=lexer native_lexer=verified native_token_stream=WP_MySQL_Native_Token_Stream native_token_count=18 native_parser=selected |
playground-sqlite-db-apply |
3.53 s | 3.61 s | ⚪ -81 ms (-2.2%) | ✓ | condition=db-apply to SQLite in PHP.wasm runtime=php.wasm 8.3 wp_mysql_parser=enabled mode=parser native_lexer=verified native_token_stream=WP_MySQL_Native_Token_Stream native_token_count=18 native_parser=verified native_ast=WP_MySQL_Native_Parser_Node sqlite_driver_parser=verified trunk: condition=db-apply to SQLite in PHP.wasm runtime=php.wasm 8.3 wp_mysql_parser=enabled mode=parser native_lexer=verified native_token_stream=WP_MySQL_Native_Token_Stream native_token_count=18 native_parser=verified native_ast=WP_MySQL_Native_Parser_Node sqlite_driver_parser=verified |
| Total | 13.09 s | 12.93 s | ⚪ +155 ms (+1.2%) |
Numbers carry runner noise; treat single-run deltas as directional, not authoritative.
📈 Trunk performance history — commit-by-commit timeline.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it does
Adds an opt-in
--experimental-sqlite-row-streampath for SQLitedb-apply.When enabled during
db-pull, the importer writes.import-sqlite-row-stream.jsonl: a JSONL sidecar with one record per SQL statement. Producer-shapedINSERTstatements are stored as structured table/column/typed row data; unsupported statements store byte ranges intodb.sqlso SQLite apply can fall back to the existing SQL path.When enabled during SQLite
db-apply, the importer consumes the sidecar and executes structured inserts through cached PDO prepared statements without reparsing the original SQL text. Fallback records still execute through the existing structured URL rewriting and MySQL-on-SQLite path.Rationale
The current PHP.wasm SQLite apply profile spends most of its time rebuilding prepared insert templates from SQL text. The sidecar shifts that structural parse into a single
db-pullpass and keepsdb-applyon typed row records.This keeps the correctness boundary explicit:
strposshortcutsImplementation
Adds
SQLiteRowStreamSidecar, which:meta,insert, and fallbacksqlrecordsFastInsertScannerfor producer-shaped rowsnull, empty string, numeric, and base64 payload values as typed recordsImporter integration:
db-pull --experimental-sqlite-row-streamwrites the sidecar afterdb.sqlcompletesdb-apply --experimental-sqlite-row-stream --target-engine=sqliteconsumes that sidecarrow_stream_bytes_readalongside existing SQL byte progress, including partial row-stream resumesdb.sqlbyte lengthBENCH_DB_PULL_EXTRA_ARGSandBENCH_DB_APPLY_EXTRA_ARGSBenchmarks were run under
/tmp/reprint-bench.lock.origin/trunkplayground-sqlite-db-applyplayground-sqlite-db-pullBaseline commands, run on
origin/trunk:Branch commands:
Testing instructions