Skip to content

Performance: Add UI perf scenarios and row detail timing#195

Merged
priethor merged 9 commits into
mainfrom
priethor/add/perf-scenarios
May 15, 2026
Merged

Performance: Add UI perf scenarios and row detail timing#195
priethor merged 9 commits into
mainfrom
priethor/add/perf-scenarios

Conversation

@priethor

@priethor priethor commented May 15, 2026

Copy link
Copy Markdown
Collaborator

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 is p95_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_open in WP-CLI, split into resolve, hydrate, and total timings.
  • Collections: open, paginate into rollup-heavy rows, sort, and search.
  • Rows: open detail, create a row, and move to the next row.
  • Columns: open column actions and rename a column inline.
  • Shell: workspace home, warm sidebar navigation, page editor load, and command palette open.

Updates the benchmark workflow to:

  • Run 10 measured iterations instead of 5.
  • Keep --fail-on-budget enabled.
  • Retry once only when all budget misses are p95_ms.
  • Still fail immediately for SQL or memory budget misses.

Testing Instructions

  1. Seed the perf dataset with wp cortext perf-seed --reset --force.
  2. Run wp cortext perf-bench --pretty and check that row_detail_open reports total, resolve, and hydrate timings.
  3. Run the UI perf suite with CORTEXT_PERF_UI=1 and check that it writes artifacts/perf-ui.json.
  4. Run .github/scripts/write-perf-ui-summary.php --current=artifacts/perf-ui.json and check that the output is grouped by category.

priethor added 5 commits May 15, 2026 12:23
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.
@priethor priethor changed the title Add UI perf scenarios and row detail timing Performance: Add UI perf scenarios and row detail timing May 15, 2026
@priethor priethor merged commit 37beef2 into main May 15, 2026
7 checks passed
@priethor priethor deleted the priethor/add/perf-scenarios branch May 15, 2026 11:25
@priethor priethor added this to the 0.1.0 milestone May 28, 2026
@priethor priethor added type: enhancement Improvement to existing behavior. area: performance Performance budgets, profiling, benchmarks, and regressions. labels May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: performance Performance budgets, profiling, benchmarks, and regressions. type: enhancement Improvement to existing behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant