Skip to content

🤖 tests: record in-page perf milestones for workspace open - #4456

Merged
ThomasK33 merged 1 commit into
mainfrom
perf/in-page-milestones
Sep 24, 2026
Merged

ThomasK33 merged 1 commit into
mainfrom
perf/in-page-milestones

Conversation

@ThomasK33

Copy link
Copy Markdown
Member

Summary

The workspace-open perf scenarios now record in-page milestone times: first transcript row ("useful content ready"), data-loaded ("fully revealed"), and the longest main-thread task. They're written into perf-summary.json, so these numbers no longer depend on when Playwright's assertion polling happens to notice the change. Addresses #4441.

Background

The nightly workspace-open-large numbers stepped up on 09-21. The investigation in #4441 showed that was mostly a change in what the spec measures, not extra work:

The small real leftover was fixed by #4427.

Implementation

  • tests/e2e/utils/pageMilestones.ts:
    • A MutationObserver records the first chat-message row inside the message window and the data-loaded="true" flip. Its callbacks run in the same task as the DOM change, so there is no polling quantization.
    • A longtask PerformanceObserver records the longest task, and pending entries are drained on read.
    • It asserts it wasn't started twice, the window isn't already loaded at start (otherwise the milestone would read 0), and the first message never comes after full load.
  • writePerfArtifacts takes an optional milestones field, written as a top-level key. The change is additive, so schemaVersion stays 1.
  • The workspace-open spec starts the milestones right before opening the workspace and asserts that fullyLoadedMs was captured.
  • Out of scope: versioning the measurement contract (so a trend baseline resets when a milestone changes meaning) belongs with the deferred trend reporter in 🤖 perf: deferred nightly perf report (continuation of #4437) #4442.

Validation

Local, dist build: perf.workspaceOpen.spec.ts --repeat-each=3, 18/18 passed. Medians in ms:

Scenario First message Fully loaded Longest task Playwright wall Wall minus loaded
large 806 1448 274 1547 171
medium 772 907 184 1016 123
tool-heavy 772 884 131 1063 179
reasoning-heavy 792 891 112 1091 195
large-diff 1036 1089 101 1103 12
small (first test in the worker, cold) 1135 1135 170 1189 54

The last column is the polling overhead that the old wall-clock number included.

Risks

Test-only. The observer adds one or two querySelector calls per mutation batch inside the profiled window, until both milestones are seen. That's negligible next to the ~800 ms of script time.


Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-24T19:49:30.227330Z 57a8ce5 PR opened
🔒 Security Review ✅ Completed 2026-09-24T19:49:45.933515Z 57a8ce5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

1 participant