[PHP] Prepare cautious URL mappings once - #588
Open
adamziel wants to merge 1 commit into
Open
Conversation
Contributor
Pull pipeline performance —
|
| Stage | PR | trunk | Δ | Status | Details |
|---|---|---|---|---|---|
playground-sqlite-db-pull |
9.86 s | 9.67 s | ⚪ +187 ms (+1.9%) | ✓ | 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.82 s | 3.70 s | ⚪ +114 ms (+3.1%) | ✓ | 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.68 s | 13.38 s | ⚪ +300 ms (+2.2%) |
Numbers carry runner noise; treat single-run deltas as directional, not authoritative.
📈 Trunk performance history — commit-by-commit timeline.
adamziel
force-pushed
the
codex/prepare-cautious-url-mappings
branch
from
August 14, 2026 00:25
c5f11be to
6fd889c
Compare
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.
Prepares cautious URL mappings once per
StructuredDataUrlRewriterinstead of rebuilding them for each text leaf.CautiousURLBaseRewriteMappingnow owns URL validation, longest-source ordering, and pattern construction. Low-level cautious processors require that prepared object, so callers cannot accidentally rebuild the same mapping for every text value. Plain-text and block-markup processors share the one object created byStructuredDataUrlRewriter.On the local benchmark, constructing a processor with one mapping fell from 1.75 µs to 0.09 µs. With 64 mappings it fell from 106 µs to 0.09 µs. Rewriting one short matching value fell from 3.23 µs to 1.37 µs.
Testing
The URL rewriting suite passes with 363 tests and 2,502 assertions. The focused cautious and structured suites pass with 180 tests and 219 assertions. PHPStan and the coding-standard checks pass for the changed classes.