[PHP] Add FileIndexDiffProcessor to share file-index comparison logic between push and pull - #541
Merged
Merged
Conversation
This was referenced Aug 10, 2026
Contributor
Pull pipeline performance —
|
| Stage | PR | trunk | Δ | Status | Details |
|---|---|---|---|---|---|
playground-sqlite-db-pull |
9.36 s | 9.29 s | ⚪ +68 ms (+0.7%) | ✓ | 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.86 s | 3.58 s | ⚪ +274 ms (+7.7%) | ✓ | 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.22 s | 12.87 s | ⚪ +342 ms (+2.7%) |
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.
Adds
FileIndexDiffProcessor, a single-pass, resumable traversal over an old and new path-sorted filesystem index. It labels each current path asadded,modified,deleted, orunchanged, so callers choose an operation without rebuilding the index comparison.PushPlannow uses the same processor.Usage
Create the comparison and select its first path:
get_path_transition()describes the difference between the old and new index records. A path present in both indexes ismodifiedwhen its type, size, or ctime differs:The per-index getters expose record details when an operation needs them:
When a path is absent from an index, the neighboring-path getters describe the position where it would occur. For a path deleted from the new index:
For a path added to the new index, inspect the following path in the old index:
A following-path getter requires the current path to be absent from that index. Otherwise the processor has not read the entry after the current path and rejects the call.
Resume from the cursor stored after
next_path()advances past a processed path:A selected path is not part of the cursor until the following
next_path()call advances past it. Closing before that call leaves the path available for replay after resume. Both index files must remain unchanged while a cursor may be resumed.The processor holds at most one unread entry from each index. Its dedicated tests cover all four transition labels, decoded-path ordering, preceding and following paths, cursor movement, resume, missing indexes, EOF, and close.
#468 follows this PR in the stack.
Testing