From 24de2d163d1b0f9b14e21376d61fad60b87299c6 Mon Sep 17 00:00:00 2001 From: Kyle Sexton <153232337+kyle-sexton@users.noreply.github.com> Date: Sun, 1 Nov 2026 09:23:48 -0500 Subject: [PATCH] perf(planning): open the journey suite's browser with settle 0 Each journey phase is its own playwright-cli run-code call. After the script returns, run-code waits its settle time (500 ms by default), then waits for the script's requests to finish and settles again: about 1 s per call (waitForCompletion in playwright-core's coreBundle.js). A trivial run-code measured 0.72 s at the default and 0.25 s with PLAYWRIGHT_MCP_TIMEOUT_SETTLE=0. The setting is read only when the session opens, so the suite sets it at pw open for the journey part alone; the other parts' groups keep the default. Merging phases into fewer calls was mapped and left out: only 9|10, 11|12 and 16|17 have no shell step between them, and each merge would now save about 0.25 s. Local wall times, surface-journey.test.sh, PASS=256 FAIL=0 on every run: - before: 68.5, 70.3, 69.5, 72.8 s (sum of per-phase lines 60, 62, 60, 61 s) - after: 52.1, 51.4, 60.0, 64.3, 53.4 s (per-phase sums 44, 44, 49, 55, 45 s) Median 69.9 s to 53.4 s. The 60.0 and 64.3 s runs came with slower shell steps too (apply 2.8 s against 1.7 to 2.0 s), host load. Refs: #8757 Co-Authored-By: Claude Opus 5.5 --- .changes/planning/perf-8757-journey-settle-0-7d2a5e91.md | 7 +++++++ plugins/planning/surface/surface-checks.sh | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .changes/planning/perf-8757-journey-settle-0-7d2a5e91.md diff --git a/.changes/planning/perf-8757-journey-settle-0-7d2a5e91.md b/.changes/planning/perf-8757-journey-settle-0-7d2a5e91.md new file mode 100644 index 00000000000..f7e90ba17ca --- /dev/null +++ b/.changes/planning/perf-8757-journey-settle-0-7d2a5e91.md @@ -0,0 +1,7 @@ +--- +bump: none +--- + +### Changed + +- surface-journey test: its browser session opens with playwright-cli's settle time at 0, so the twenty phase scripts, which wait for what they check themselves, no longer pay about 1 s each of post-script waiting. diff --git a/plugins/planning/surface/surface-checks.sh b/plugins/planning/surface/surface-checks.sh index d648e6654c4..a9baabacd7b 100755 --- a/plugins/planning/surface/surface-checks.sh +++ b/plugins/planning/surface/surface-checks.sh @@ -159,7 +159,14 @@ if command -v playwright-cli >/dev/null 2>&1; then # prereq-ok: test-only, run b pw run-code --filename "$(script_path "$1")" >"$2" 2>&1 echo "$((SECONDS - start))" >"$2.secs" } - pw open >/dev/null 2>&1 + # After each run-code, playwright-cli waits its settle time (500 ms by default), and again once the + # script's requests finish: about 1 s a call. The journey's twenty phase scripts wait for what they + # check themselves, so its own suite's session skips that wait. The setting is read only at open. + if [[ "$part" == journey ]]; then + PLAYWRIGHT_MCP_TIMEOUT_SETTLE=0 pw open >/dev/null 2>&1 + else + pw open >/dev/null 2>&1 + fi group_ab() { mkdir -p "$d"