Use native batch URL rewrites for text nodes#284
Draft
adamziel wants to merge 1 commit into
Draft
Conversation
4903777 to
684a29c
Compare
e4a51e3 to
882768c
Compare
Collaborator
Author
|
Rebased this stack on current Sample: 5,000
This did not confirm the hypothesis that the stacked native batch text rewrite has no meaningful improvement after #283. It is still materially faster on this content sample. Caveat: the rebased native-extension CI is currently failing URL text parity tests in the native-extension job, so this stack is not merge-ready as-is. |
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
Stacks on #282 and routes
wp_rewrite_urls()text-node rewriting throughwp_native_apis_rewrite_text_url_bases()when the native function is available.The native fast path is intentionally narrow:
#texttokens are sent to the native batch rewriter;Why
#282 adds the coarse native primitive, but the public
wp_rewrite_urls()path does not call it. This PR shows what kind of speedup is available when a public rewrite workflow uses that native primitive without running it over raw block markup wholesale.Benchmark
Same 5,000 sampled
post_contentvalues used in the reprint experiments: 16.85 MB decoded, 5,000 changed values. PHP.wasm 8.4.21 with a locally built #282wp_native_apisextension.wp_rewrite_urls()44c9750cb310ad822ce73840290c647e609b78ee047365b60f9f123aeed5d9bc44c9750cb310ad822ce73840290c647e609b78ee047365b60f9f123aeed5d9bcThat is about 40.9x faster than #282 alone on this sample. For context, #283's merged native scanner/cache path measured around 3.5s on the same sample, so this points to another meaningful improvement once #282 is available.
Testing