Performance: Add UI perf scenarios and row detail timing#195
Merged
Conversation
The shell opens a row with two REST hops: the document locator returns the rest_base, then core REST hydrates the record (including the cortext_hydrated_meta payload with relations and rollups). Add a stepped scenario that times both calls separately so the resolver stays visible if it ever grows, plus the aggregate as the budget-tracked metric. summarize_stepped_samples is exposed so the shape stays testable without running the full bench.
Collections store their slug in meta, not post_name, so the standard WP REST `?slug=` filter is useless. The helper lists the small seed set and picks the matching meta value, returning the admin shell query the UI perf spec navigates to.
Thirteen scenarios across five categories cover the user-facing flows that the WP-CLI bench cannot measure (DOM mount, paint, REST waterfall, longtask total). Gated by CORTEXT_PERF_UI=1 so the regular e2e suite stays cheap; runs serially in one worker so the shared scenarios map is captured in a single perf-ui.json artifact. Each scenario records ready_ms, rows_api_ms, rest_request_count, and longtask total/max. Scenarios are tagged with a category (collection read, row, column, navigation, surface) so the summary renderer can group them without nesting the JSON. Out of scope for v1: row trash (ConfirmDialog needs trace-level debug for the focus-trap timing) and filter apply (multi-step UI chain without a stable selector path).
Reads artifacts/perf-ui.json and prints a single markdown table grouped by scenario category, with section header rows in bold so the workflow summary stays scannable. Writes to stdout and appends to $GITHUB_STEP_SUMMARY when present. A follow-up will wire the renderer into the perf-bench workflow as the step right after the UI perf run.
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
Adds a Playwright perf run for Cortext, plus one missing row-detail case in the existing WP-CLI benchmark.
The browser run uses the seeded perf dataset and writes
artifacts/perf-ui.json. The workflow also keeps the benchmark gate required, but makes it less flaky: it now runs more samples and retries once when the only budget miss isp95_ms.Why
The server benchmark was already in place, but we still had no data around row detail and browser-visible flows.
Latency in GitHub runners can spike hard without any SQL or memory change, so the retry keeps the gate useful without turning runner noise into a failing PR.
How
Adds perf checks for:
row_detail_openin WP-CLI, split into resolve, hydrate, and total timings.Updates the benchmark workflow to:
--fail-on-budgetenabled.p95_ms.Testing Instructions
wp cortext perf-seed --reset --force.wp cortext perf-bench --prettyand check thatrow_detail_openreports total, resolve, and hydrate timings.CORTEXT_PERF_UI=1and check that it writesartifacts/perf-ui.json..github/scripts/write-perf-ui-summary.php --current=artifacts/perf-ui.jsonand check that the output is grouped by category.