Skip to content

HTML API: add a parsing benchmark tool under tests/performance/html-api - #97

Open
sirreal wants to merge 652 commits into
trunkfrom
html-api/benchmark
Open

sirreal wants to merge 652 commits into
trunkfrom
html-api/benchmark

Conversation

@sirreal

@sirreal sirreal commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Add a parsing benchmark for the HTML API under tests/performance/html-api/, so a change to WP_HTML_Tag_Processor or WP_HTML_Processor can be measured against a baseline checkout with a confidence interval instead of a pair of wall-clock numbers.

The timed loop constructs a processor and calls next_token() until it returns false, for the Tag Processor and for the HTML Processor through create_full_parser(). Nothing else is timed: no get_tag(), no attribute reads, no modifications. A document the HTML Processor cannot finish is still timed but reported separately and left out of the aggregate.

php tests/performance/html-api/bench.php --base ~/a8c/wordpress-develop/trunk --head .

How a run works:

  • bench.php starts one worker.php process per checkout. Each worker loads that checkout's src/wp-includes/html-api/ with stubs for the few WordPress functions it calls (__(), esc_url(), wp_kses_uri_attributes() and similar), so WordPress itself is not loaded and --base may point at a checkout that predates this tool.
  • Samples alternate between the two trees, and the tree that goes first alternates each sample, so machine drift lands on both sides of the ratio.
  • The report gives, per document and parser, the median per tree, the change, a 95% interval on the ratio of medians, a verdict (faster, slower, no difference), and the coefficient of variation of each tree's samples; then a geometric-mean overall line per parser with its own interval. Output is a table, markdown or JSON; --save keeps every sample, and compare.php compares two saved runs.

Documents:

  • lib/class-benchmark-synthetic.php generates 13 shapes at a target size (default 200 KB) from a seed: dense tags, long text, entities, multi-byte text, many comments, attribute-heavy tags, deep nesting, script and style bodies, whitespace runs, inline SVG and MathML, misnested formatting, tables, and a block-themed WordPress post. Output is byte-identical for a given seed on PHP 8.4 and 8.5, and every shape parses to the end on trunk's HTML Processor. The tables and formatting-adoption shapes stay inside what trunk supports, since foster parenting and the general adoption agency case still bail.
  • corpus/manifest.json names 20 public pages with sizes and hashes (the HTML standard's parsing section, the W3C HTML5 syntax chapter, RFC 9110, seven Wikipedia articles in four scripts pinned by revision, five WordPress-rendered pages, an MDN reference, a php.net manual page, Hacker News), plus the 15 MB single-page HTML standard behind --include-optional. fetch-corpus.php restores them into the gitignored corpus/real/; nothing third-party is committed. --corpus <dir> reads any directory of HTML files.

One measurement result shaped the defaults. Two PHP processes running identical code differ by a constant 0.3% to 2% for the life of the process, and the second-started one is the slower, so interleaving within a process pair cannot cancel it: a one-round A/A run reported slower at +1.8% on every HTML Processor row with CVs of 0.2%. The tool therefore repeats the schedule over --rounds fresh worker pairs and takes a t-interval over the per-round ratios; the default is 4 rounds of 10 samples because an odd count leaves the start order unbalanced (3 rounds gave 8 of 64 rows slower, all the same sign). With the defaults, an A/A run over all 32 documents reports no difference on all 64 rows, with both overall intervals centred on zero; per-row resolution is about ±1%, and a full run takes about 34 minutes on an M-series laptop.

As a first use, replacing the two length-1 strspn() set checks in the Tag Processor's parse loop with strpos() on the set measured -1.2% [-2.3%, -0.2%] on the Tag Processor and -0.6% [-1.5%, +0.4%] on the HTML Processor, every point estimate negative, with identical token output. That change is not in this PR.

Limitations: the WHATWG pages are fetched unpinned because the site's robots.txt disallows /commit-snapshots/, and the Wikipedia pages carry per-request values so their hashes are informational; fetch-corpus.php reports drift on unpinned entries rather than failing. SPEC.md is the design document the tool was built from and can be dropped before any upstream PR.

Trac ticket: none yet; this is a fork PR for review of the tool itself. trac#65967 (the HTML API fuzzing ticket) is the nearest existing ticket.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Fable 5.1
Used for: Implementation, corpus selection, synthetic document generator, documentation and the validation runs, from a design settled in a question round with the author. The author has not yet reviewed the code line by line; the A/A validation and the strspn experiment were run and read by the agent.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

afercia and others added 30 commits September 28, 2026 10:50
Lints the `src/wp-admin/css/edit.css` file.
Part of the ongoing effort to lint all the admin CSS files.

Developed in WordPress#13137

See #65898.


git-svn-id: https://develop.svn.wordpress.org/trunk@63971 602fd350-edb4-49c9-b593-d223f7449a82
Lints the `src/wp-admin/css/forms.css` file.
Part of the ongoing effort to lint all the admin CSS files.

Developed in WordPress#13139

See #65898.


git-svn-id: https://develop.svn.wordpress.org/trunk@63972 602fd350-edb4-49c9-b593-d223f7449a82
Lints the `src/wp-admin/css/install.css` file.
Part of the ongoing effort to lint all the admin CSS files.

Developed in WordPress#13140

See #65898.


git-svn-id: https://develop.svn.wordpress.org/trunk@63973 602fd350-edb4-49c9-b593-d223f7449a82
Amends [63965].
Part of the ongoing effort to lint all the admin CSS files.

See #65898.


git-svn-id: https://develop.svn.wordpress.org/trunk@63974 602fd350-edb4-49c9-b593-d223f7449a82
Replace the empty schema test with assertions for the OPTIONS response,
schema title, and exposed setting properties. Account for the URL and email
settings being available only on single-site installations.

Developed in: WordPress#13798

Props shailu25.
See #40538.


git-svn-id: https://develop.svn.wordpress.org/trunk@63975 602fd350-edb4-49c9-b593-d223f7449a82
Replace the empty schema test with assertions for a successful OPTIONS
response and the eight exposed pattern properties.

Developed in: WordPress#13799

Props shailu25.
See #40538.


git-svn-id: https://develop.svn.wordpress.org/trunk@63976 602fd350-edb4-49c9-b593-d223f7449a82
…ependency.

Use a data provider containing 21 distinct GlotPress plural expressions, with a pinned source reference, instead of downloading the locale file. Keep comparing the real parser with the legacy evaluator for values from 0 through 200, and run this coverage in the default test suite.

Remove the download-only locale availability test.

Developed in: WordPress#13755

Props adrianmoldovanwp, mukesh27, mindctrl.
See #63914.


git-svn-id: https://develop.svn.wordpress.org/trunk@63977 602fd350-edb4-49c9-b593-d223f7449a82
Verify that the OPTIONS response exposes the expected pattern-directory-item schema title, complementing the existing property checks.

Follow-up to [63976].

Developed in: WordPress#13801

Props shailu25.
See #40538.


git-svn-id: https://develop.svn.wordpress.org/trunk@63981 602fd350-edb4-49c9-b593-d223f7449a82
The `wp_edit_theme_plugin_file()` function determined whether a plugin was active by only checking the site-level `active_plugins` option, so network-active plugins were treated as inactive and the loopback request that checks for fatal errors was skipped when editing their PHP files. Now `is_plugin_active()` is used instead, which also accounts for network activation.

Developed in WordPress#13620.
Follow-up to r41721, r63957.

Props rainynewt, westonruter, denisflorin117.
See #66133.
Fixes #66129.


git-svn-id: https://develop.svn.wordpress.org/trunk@63982 602fd350-edb4-49c9-b593-d223f7449a82
Updates jQuery Migrate from 3.4.1 to 3.6.0. This also removes the library from the committed `src/js/_enqueues/vendor/jquery/` directory in favour of updating via NPM.

This is the first step in the upgrade path for jQuery 4.0.

Developed in WordPress#13787.

Props clorith, jorbin, mukesh27, westonruter.
Fixes #66203.
See #60478.




git-svn-id: https://develop.svn.wordpress.org/trunk@63983 602fd350-edb4-49c9-b593-d223f7449a82
Props jorgelopezrepiso, mukesh27.
Fixes #66034.
See #65860.



git-svn-id: https://develop.svn.wordpress.org/trunk@63984 602fd350-edb4-49c9-b593-d223f7449a82
Lints the `src/wp-admin/css/list-tables.css` file.
Part of the ongoing effort to lint all the admin CSS files.

Developed in WordPress#13142

See #65898.


git-svn-id: https://develop.svn.wordpress.org/trunk@63985 602fd350-edb4-49c9-b593-d223f7449a82
Lints the `src/wp-admin/css/login.css` file.
Part of the ongoing effort to lint all the admin CSS files.

Developed in WordPress#13143

See #65898.


git-svn-id: https://develop.svn.wordpress.org/trunk@63986 602fd350-edb4-49c9-b593-d223f7449a82
Lints the `src/wp-admin/css/media.css` file.
Part of the ongoing effort to lint all the admin CSS files.

Developed in WordPress#13144

See #65898.


git-svn-id: https://develop.svn.wordpress.org/trunk@63987 602fd350-edb4-49c9-b593-d223f7449a82
Lints the `src/wp-admin/css/nav-menus.css` file.
Part of the ongoing effort to lint all the admin CSS files.

Developed in WordPress#13145

See #65898.


git-svn-id: https://develop.svn.wordpress.org/trunk@63988 602fd350-edb4-49c9-b593-d223f7449a82
Lints the `src/wp-admin/css/site-health.css` file.
Part of the ongoing effort to lint all the admin CSS files.

Developed in WordPress#13147

See #65898.


git-svn-id: https://develop.svn.wordpress.org/trunk@63989 602fd350-edb4-49c9-b593-d223f7449a82
Lints the `src/wp-admin/css/themes.css` file.
Part of the ongoing effort to lint all the admin CSS files.

Developed in WordPress#13149

See #65898.


git-svn-id: https://develop.svn.wordpress.org/trunk@63990 602fd350-edb4-49c9-b593-d223f7449a82
Lints the `src/wp-admin/css/widgets.css` file.
Part of the ongoing effort to lint all the admin CSS files.

Developed in WordPress#13150

See #65898.


git-svn-id: https://develop.svn.wordpress.org/trunk@63991 602fd350-edb4-49c9-b593-d223f7449a82
Lints the `src/wp-includes/css/customize-preview.css` file.
Part of the ongoing effort to lint all the admin CSS files.

Developed in WordPress#13161

See #65898.


git-svn-id: https://develop.svn.wordpress.org/trunk@63992 602fd350-edb4-49c9-b593-d223f7449a82
Lints the `src/wp-includes/css/dashicons.css` file.
Part of the ongoing effort to lint all the admin CSS files.

Developed in WordPress#13162

See #65898.


git-svn-id: https://develop.svn.wordpress.org/trunk@63993 602fd350-edb4-49c9-b593-d223f7449a82
Lints the `src/wp-includes/css/editor.css` file.
Part of the ongoing effort to lint all the admin CSS files.

Developed in WordPress#13164

See #65898.


git-svn-id: https://develop.svn.wordpress.org/trunk@63994 602fd350-edb4-49c9-b593-d223f7449a82
Lints the `src/wp-includes/css/media-views.css` file.
Part of the ongoing effort to lint all the admin CSS files.

Developed in WordPress#13166

See #65898.


git-svn-id: https://develop.svn.wordpress.org/trunk@63995 602fd350-edb4-49c9-b593-d223f7449a82
Lints the `src/wp-admin/css/colors/_admin.scss` file.
Part of the ongoing effort to lint all the admin CSS files.

Developed in WordPress#13172

See #65898.


git-svn-id: https://develop.svn.wordpress.org/trunk@63996 602fd350-edb4-49c9-b593-d223f7449a82
…css.

Lints the `src/wp-includes/css/wp-embed-template-ie.css` file.
Part of the ongoing effort to lint all the admin CSS files.

Developed in WordPress#13797

See #65898.


git-svn-id: https://develop.svn.wordpress.org/trunk@63997 602fd350-edb4-49c9-b593-d223f7449a82
Amends [63990].
Part of the ongoing effort to lint all the admin CSS files.

See #65898.


git-svn-id: https://develop.svn.wordpress.org/trunk@63998 602fd350-edb4-49c9-b593-d223f7449a82
Registered icons can now define optional search keywords, and icon search in the registry and the REST API matches them as well as the icon's name and label.

Developed in: WordPress#13672

Props n8finch, tayyiba66, wildworks.
Fixes #66158.


git-svn-id: https://develop.svn.wordpress.org/trunk@63999 602fd350-edb4-49c9-b593-d223f7449a82
Developed in WordPress#13483.

Follow-up to r43751.

Props mukesh27.
See #65860.

git-svn-id: https://develop.svn.wordpress.org/trunk@64001 602fd350-edb4-49c9-b593-d223f7449a82
Replace empty test methods with assertions that unsupported menu-location and block-renderer requests return rest_no_route with status 404. Use authenticated users and valid item fixtures, and retain coverage for the block renderer's supported POST requests.

Leave the abstract test base and prepare-item stubs unchanged for further discussion.

Developed in: WordPress#13817

Props shailu25.
See #66073.


git-svn-id: https://develop.svn.wordpress.org/trunk@64004 602fd350-edb4-49c9-b593-d223f7449a82
Create the site icon attachment record directly instead of uploading an image and generating thumbnails. The REST index test checks the attachment ID and URL, so physical image files and dimensions are unnecessary.

Preserve URL resolution through the WordPress attachment APIs and all existing assertions while reducing fixture setup time.

Developed in: WordPress#13823

Props sainathpoojary.
See #66074.


git-svn-id: https://develop.svn.wordpress.org/trunk@64005 602fd350-edb4-49c9-b593-d223f7449a82
Avoid initializing the REST server for tests that do not use it. Initialize it explicitly in route tests and reset the global server between tests. Remove redundant server restoration from preload tests.

Developed in: WordPress#13694

Props sainathpoojary, mindctrl.
See #66074.


git-svn-id: https://develop.svn.wordpress.org/trunk@64006 602fd350-edb4-49c9-b593-d223f7449a82
afercia and others added 29 commits October 10, 2026 16:19
- Makes sure the attachments visible label (and aria-label) is updated and it's not stale showing "uploading..." or "(no title)" for attachments whose models load after the view is created.
- Add QUnit tests.

Developed in WordPress#13053

Props sureshsornapudi09, archon810, rezwanshiblu1952, joedolson, afercia.
See #23562, #64883, #65438.
Fixes #65852.


git-svn-id: https://develop.svn.wordpress.org/trunk@64293 602fd350-edb4-49c9-b593-d223f7449a82
Some code in `WP_HTML_Processor` is written to mirror the steps of the HTML specification, so that it can be compared against the living standard as it changes and extended as more of it is supported. Static analysis reports parts of that structure as unreachable or redundant, which is accurate but beside the point. In r64250 two such places were restructured to satisfy PHPStan: the `else` branch for a `FORM` end tag in `step_in_body()`, which corresponds to the specification's "Otherwise" steps, and the `is_tag_closer()` checks for end tags in `step_in_foreign_content()`, which spell out the specification's "An end tag whose tag name is…" conditions. Both are reverted, along with the trailing `bail()` calls those methods need again.

The errors these intentional constructs produce, along with a false positive where PHPStan does not see that `bookmark_token()` sets `$last_error` before throwing, are now ignored in the HTML API section of `phpstan.neon.dist` with an explanation, rather than left in baselines that invite contributors to fix them. The remaining baseline errors for the HTML API are genuine and are fixed:

* The bookmark counter is cast to a string before being passed to `set_bookmark()`.
* The `$node` variable is initialized before a loop that may not iterate.
* The `$is_closing_tag` property is documented as nullable.
* Redundant `isset()` checks on the always-set `WP_HTML_Text_Replacement::$text` property are removed.

This empties the `catch.neverThrown` baseline, which is deleted.

Developed in WordPress#14141.
Follow-up to r58779, r58871, r64250.

Props westonruter, dmsnell.
See #65817.


git-svn-id: https://develop.svn.wordpress.org/trunk@64294 602fd350-edb4-49c9-b593-d223f7449a82
…er::$allow_batch`.

`WP_REST_Posts_Controller::$allow_batch` is documented as `array`, while `WP_REST_Attachments_Controller`, `WP_REST_Font_Faces_Controller` and `WP_REST_Font_Families_Controller` override it with `false` to opt out of batching. PHPStan reports this as a PHPDoc type that is not covariant with the parent.

`false` is a supported value, as documented for the `allow_batch` route option in `WP_REST_Server` (`array{v1?: bool}|false`). `WP_REST_Server::serve_batch_request_v1()` explicitly handles this value, rejecting the request with `rest_batch_not_allowed` when `allow_batch` is not an array. The parent type is therefore widened to `array|false` to match. This is a documentation-only change.

This resolves all three errors in the `property.phpDocType` PHPStan baseline, which is deleted.

Developed in WordPress#13812.

Follow-up to r52068, r57548.

Props Soean.
See #65817.

git-svn-id: https://develop.svn.wordpress.org/trunk@64295 602fd350-edb4-49c9-b593-d223f7449a82
Remove `check-node-version` from the root development dependencies because no Core script or task uses it directly. Retain its lockfile entries because `@wordpress/scripts` still requires it.

Developed in: WordPress#14127

Props mukesh27.
See #65857.


git-svn-id: https://develop.svn.wordpress.org/trunk@64296 602fd350-edb4-49c9-b593-d223f7449a82
Include `accordion.js` in `tsconfig.json` and document the `accordionSwitch()` parameter as `JQuery` to match its callers and use of jQuery methods. This adds static checking without changing runtime behavior.

Developed in: WordPress#14041

Props rahultank.
See #65997.


git-svn-id: https://develop.svn.wordpress.org/trunk@64297 602fd350-edb4-49c9-b593-d223f7449a82
Add descriptions to 30 tasks in `Gruntfile.js` so `grunt --help` explains their purpose instead of showing generic placeholders. Preserve task implementations and lists, and retain the existing description for the `apply` alias.

Developed in: WordPress#13915

Props sabbir345.
Fixes #65858.


git-svn-id: https://develop.svn.wordpress.org/trunk@64298 602fd350-edb4-49c9-b593-d223f7449a82
Fix a bug where triggering the image edit panel multiple times would successively remove keyboard access to edit controls, beginning with the 2nd instantiation.

Adjust the logic to ensure that `tabindex="-1"` is only applied to notices, and not to editing controls.

Developed in WordPress#12921.

Props afercia, rishabhwp, abdullah17, joedolson.
Fixes #65814.

git-svn-id: https://develop.svn.wordpress.org/trunk@64299 602fd350-edb4-49c9-b593-d223f7449a82
Run `$wpdb->remove_placeholder_escape()` on the prepared database query when generating the cache key.

The WPDB placeholder varies each time WordPress is executed so without replacement the cache key is unstable resulting in an unreachable cache entry.

Follow up to r64043.
Developed in WordPress#14146

Props maheshbohara, therssoftware.
Fixes #66282.
See #64250.



git-svn-id: https://develop.svn.wordpress.org/trunk@64300 602fd350-edb4-49c9-b593-d223f7449a82
In most cases, changing the order and position of dashboard or post meta boxes is an occasional need. When it's not needed, the extra two controls for every meta box create a high number of extra tab stops and a busy design. The drag and drop can result in accidental moves and difficulty scrolling on mobile devices due to accidental touch effects.

Add a screen option that allows users to disable moving meta boxes, disabling mover buttons and drag and drop behavior. The setting is defaulted to enable moving meta boxes, so there is no change in the default experience for users.

Developed in WordPress#12627.

Props azaozz, pbiron, afercia, johnbillion, hellofromtonya, helen, knutsp, johnjamesjacoby, garrett-eclipse, margaretschneider, johnstonphilip, hedgefield, sanketparmar, poligilad, sabernhardt, tyxla, jillq, sarahricker, ryokuhi, poena, abrain, SergeyBiryukov, joedolson.
Fixes #50699, #51419.

git-svn-id: https://develop.svn.wordpress.org/trunk@64301 602fd350-edb4-49c9-b593-d223f7449a82
Adds `aria-describedby` associations for the username and biographical info fields, password reset link button, and session action buttons on profile and user edit screens.

Props johnjamesjacoby, therssoftware, joedolson.
Fixes #66213.


git-svn-id: https://develop.svn.wordpress.org/trunk@64302 602fd350-edb4-49c9-b593-d223f7449a82
HTML templates can't contain translatable strings, and the primary menu needs a default ARIA label. Move the primary navigation into a hidden pattern and add the ARIA label.

Developed in WordPress#14091.

Props joedolson, rahultank, mukesh27, dhruvang21.
Fixes #66195.

git-svn-id: https://develop.svn.wordpress.org/trunk@64303 602fd350-edb4-49c9-b593-d223f7449a82
Per the [https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/ inline documentation standards], `@return` tags should only contain the type and an optional description, not the name of the returned variable. This commit removes the variable names from all remaining `@return` tags in core.

Developed in WordPress#13844.

Props Soean, mukesh27.
See #65860.

git-svn-id: https://develop.svn.wordpress.org/trunk@64304 602fd350-edb4-49c9-b593-d223f7449a82
Updates the HTTP headers for sites running the `db-error.php` or `maintenance.php` drop-ins. Previously sites running these drop-ins would send a `200 OK` HTTP response by default if they were not specified by the drop-in. These have been updated to:

* `500 Internal Server Error` for the Database Error drop-in, matching the header sent by the default call to `wp_die().
* `503 Service Unavailable` for the maintenance mode drop-in with a retry header of 10 minutes, matching the headers sent by the default call to `wp_die()`.

Developers can continue to customize these headers by sending the headers in the drop-ins.

Developed in WordPress#13471.

Props bradleyt, dineshinau, sabernhardt, westonruter.
Fixes #66080.




git-svn-id: https://develop.svn.wordpress.org/trunk@64305 602fd350-edb4-49c9-b593-d223f7449a82
Add coverage for compatible and incompatible WordPress and PHP requirements, plugin dependencies, PHP update annotations, and validation filters. Guard temporary plugin fixtures against overwrites and reset dependency state between tests.

Developed in: WordPress#14153

Props huzaifaalmesbah.
See #65819.


git-svn-id: https://develop.svn.wordpress.org/trunk@64306 602fd350-edb4-49c9-b593-d223f7449a82
Add coverage for `is_plugin_paused()`, `wp_get_plugin_error()`, and `resume_plugin()`, including successful removal of paused state and failure to resume. Restore the original recovery-mode state after each test.

Developed in: WordPress#14156

Props huzaifaalmesbah.
See #65819.


git-svn-id: https://develop.svn.wordpress.org/trunk@64307 602fd350-edb4-49c9-b593-d223f7449a82
Add coverage for valid plugins, invalid paths, missing files, and missing plugin headers. Guard temporary fixtures against overwrites and clear the plugin cache after fixture changes.

Developed in: WordPress#14157

Props huzaifaalmesbah.
See #65819.


git-svn-id: https://develop.svn.wordpress.org/trunk@64308 602fd350-edb4-49c9-b593-d223f7449a82
This commit prevents `WP_Theme_JSON` from throwing fatal TypeErrors when theme.json or global styles data contains values of the wrong type.

Those values could be user- or AI-generated.

The checks in this commit cover spacing scale arrays, block variation selectors, and custom block CSS processing.

The motivation arose from a real-life PHP fatal where `WP_Theme_JSON::process_blocks_custom_css` attempted to explode a non-string.

Developed in: WordPress#14190

Props ramonopoly, aaronrobertshaw, andrewserong.

Fixes #66286. 



git-svn-id: https://develop.svn.wordpress.org/trunk@64309 602fd350-edb4-49c9-b593-d223f7449a82
Adds tests for permission checks, `_fields` filtering, the schema, and collection parameters, and verifies that the built-in non-public `core-admin` collection is not exposed.

Developed in: WordPress#14195

Props noruzzaman, rejaulalomkhan, wildworks.
Fixes #66287.

git-svn-id: https://develop.svn.wordpress.org/trunk@64310 602fd350-edb4-49c9-b593-d223f7449a82
Adds a read-only `core/settings-get` ability that returns WordPress settings as a flat map of setting name to value, optionally narrowed by settings group, by setting name, or both. It requires the `manage_options` capability. The code lives in the new private `WP_Abilities_Settings` class.
Settings opt in with the new `show_in_abilities` argument of `register_setting()`, which defaults to `false`. When `true`, a setting is exposed.

Developed in WordPress/ai#691 and WordPress#12141.

Props jorgefilipecosta, gziolo, jorbin, justlevine, dkotter, logicrays, jason_the_adams, mukesh27, ovidiu-galatan, jeffpaul.
Fixes #64605.

git-svn-id: https://develop.svn.wordpress.org/trunk@64311 602fd350-edb4-49c9-b593-d223f7449a82
Free up space in the toolbar by replacing the "Howdy, $user" line with "$user". In turn, the greeting is moved into the user menu item, thereby replacing "$user" with "Howdy, $user".

Props fushar, tyxla, mcsf, joen.

Fixes #66157.



git-svn-id: https://develop.svn.wordpress.org/trunk@64312 602fd350-edb4-49c9-b593-d223f7449a82
Cover approval from Pending, row-level spam, inline replies, and bulk spam in the admin. Verify saved comment state and visible completion for each interaction, including reply content and parent. Create fixtures through REST and delete only those fixtures after each test.

Developed in: WordPress#12667

Props csmcneill, adrianmoldovanwp.
Fixes #65771.
See #52895.


git-svn-id: https://develop.svn.wordpress.org/trunk@64313 602fd350-edb4-49c9-b593-d223f7449a82
Add PHPUnit coverage for the registered `publish_future_post` callback: publish due posts, reschedule early calls, and ignore draft or missing posts.

Verify the Scheduled view link, filtered post IDs, and date-column labels for scheduled and past-due posts. Exercise real WordPress behavior without waiting for scheduled times.

Developed in: WordPress#12668

Props csmcneill, lucatume.
Fixes #65772.


git-svn-id: https://develop.svn.wordpress.org/trunk@64314 602fd350-edb4-49c9-b593-d223f7449a82
`wp_prepare_json_schema_for_client()` already changes an empty array `default` to an object when the type is `object`. Now it also does this when the type is a list that includes `object` but not `array`, like `array( 'object', 'null' )`. If `array` is allowed, the default stays `[]`.

Developed in WordPress#14068.
Follow-up to [62591].

Props sukhendu2002.
See #66267.



git-svn-id: https://develop.svn.wordpress.org/trunk@64315 602fd350-edb4-49c9-b593-d223f7449a82
A PHP CLI that times WP_HTML_Tag_Processor and WP_HTML_Processor parsing
(next_token() to the end of the document) over a corpus of real public
pages and seeded synthetic documents, and compares two checkouts with
interleaved samples, fresh worker processes per round and confidence
intervals on the ratio of medians.

- bench.php orchestrates one worker per checkout and prints a table,
  markdown or JSON report; compare.php compares two saved runs.
- worker.php loads one checkout's HTML API with function stubs and runs
  timed jobs over a JSON line protocol.
- lib/class-benchmark-synthetic.php generates 13 document shapes (dense
  tags, long text, entities, UTF-8, comments, attributes, deep nesting,
  script and style, whitespace, foreign content, formatting, tables, a
  WordPress post), byte-identical for a given seed across PHP versions.
- corpus/manifest.json names twenty public pages with sizes and hashes;
  fetch-corpus.php restores them into the gitignored corpus/real/.

An A/A run with the defaults (4 rounds of 10 samples) reports no
difference on all 64 rows. The README documents the method and why the
round count defaults to an even number.
…e, which this repository uses instead of nested ignore files.
…the JIT, and serialize timed runs.

Under the tracing JIT, the code paths a process compiles first set the speed
of everything it runs afterwards: a worker that parsed wordpress.org's home
page first ran it and later documents 10% to 16% slower than one that started
with another document. With one fixed order every round shared that history,
so the interval over rounds did not include it. Each round now runs the
(document, parser) pairs in an order shuffled from the seed and round number,
the same for both trees, and the saved JSON records the orders.

The HTML Processor needs about six parses before its traces settle. With
--jit the warmup is now at least 10 parses and 200 ms (--warmup-ms), which
took its CV on wporg-home from 12% to 3%.

bench.php now holds a lock on /tmp/wp-html-api-bench.lock for the whole run
and waits while another run holds it; with-lock.php runs any other command
under the same lock, for profiling and ad hoc timing. A worker with a
profiler extension loaded stops the run.
…en two checkouts.

A performance change must not change what the parser reports. difftrace.php
loads the base and head Tag Processors into one process under renamed
classes and compares the return value, every public accessor and every
_doing_it_wrong() call after every step of six walks: next_token(),
next_tag(), next_tag() visiting closers, next_tag() with queries, with
modifications, and with bookmarks and seeks. For the HTML Processor it
compares a hash of the token stream per input, one process per checkout.

Inputs are the corpus, the synthetic shapes at two sizes, edge cases with
every prefix, and 20,000 mutated corpus slices. Base against itself reports
no differences over 4.6 million steps; dropping "\r" from the whitespace
skipped around "=" or the XMP case from the special-element switch each
produce hundreds of differing inputs.
…sults.

difftrace.php gains a walk that mixes modifications with bookmarks and
seeks, special-element edge cases (case, near-miss names, NUL bytes,
leading newlines, virtual closers), and an HTML Processor pass that calls
get_updated_html() and then sets an attribute while walking, so that an
update is pending when the processor parses a virtual token or an error
again. It now finds the eight inputs on which matching special elements by
raw bytes, instead of through get_tag(), changes HTML Processor output.
get_updated_html() calls are capped at 20 per input, since each one copies
the whole document.

proc_open() no longer receives STDOUT or STDERR: PHP seeks a redirected
file's shared offset to the stream's own position before handing it on,
and the outputs overwrote each other.

The report prints each round's overall change under the overall line, so
one slow round is visible instead of only widening the interval.
@sirreal
sirreal force-pushed the html-api/benchmark branch from e9c617f to f834251 Compare October 12, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.