HTML
Fast tag scans, fragment parsing, batch queries, and aggregate audits for common WP_HTML_Tag_Processor and fragment-processor workloads.
Experimental performance preview
The Native APIs extension registers PHP extension classes for high-volume HTML, XML, and URL-in-text workloads. Public toolkit classes keep their PHP fallback behavior, so projects can try native acceleration without making the extension a hard dependency.
When the extension is loaded before the toolkit, wrappers may delegate covered operations to native classes. If the extension is missing, incompatible, or disabled with WP_NATIVE_APIS_DISABLE_DEFAULTS, the same public APIs continue through pure PHP implementations.
Fast tag scans, fragment parsing, batch queries, and aggregate audits for common WP_HTML_Tag_Processor and fragment-processor workloads.
Streaming XML token, tag, namespace, attribute, and inventory summaries for export-sized documents without building a DOM tree.
XML reference →A native candidate scanner for plain-text URL detection, while public URL handling still validates candidates through the existing WHATWG parser path.
DataLiberation reference →The Rust-backed extension is built with ext-php-rs for a specific host PHP ABI. A Linux PHP 8.3 build cannot be reused for PHP 8.4 or PHP 8.5.
Browser Playground loads a PHP.wasm side module through the php-extension URL parameter before PHP starts. The current Playground bundle is a smoke-testable extension path and should not be described as full Rust-backed host parity.
The smoke-test Blueprint writes a small PHP landing page into WordPress Playground. It checks that the native classes were registered before PHP started, runs a few representative operations, and shows quick browser-side timing numbers.
php=8.4 and the latest wp_native_apis manifest./native-api-smoke.php.wp_native_apis WASM extension loaded, then review the timing cards.The release workflow also builds the host Rust-backed extension and runs the repository benchmark harness against the same workloads in PHP and native modes. The release page publishes raw JSON plus a summarized view with wall-clock speedups.
php -d extension=extensions/native-apis/target/release/libwp_native_apis.so \
bin/benchmark-native-apis.php --iterations=50 --mode=both --disable-native-defaults --require-native
Benchmark numbers are machine- and workflow-run-specific. Treat them as directional evidence for which workflows benefit from native batching, not as universal throughput guarantees.