Skip to content

Add an env-gated UI performance harness - #54

Merged
mstallone merged 9 commits into
mainfrom
perf/ui-01-profiler-harness
Aug 2, 2026
Merged

mstallone merged 9 commits into
mainfrom
perf/ui-01-profiler-harness

Conversation

@mstallone

Copy link
Copy Markdown
Owner

TL;DR — Adds a permanent, env-gated UI profiling harness (RUNWAY_UI_PROFILE=1) plus script/profile_ui.sh, which drives the popover through scripted phases and prints open/close/stall stats. First PR of a stacked series that takes warm popup open from ~84ms to the low tens of milliseconds.

What was happening

  • Popup open felt laggy; profiling this week measured ~84ms warm / ~133ms cold click-to-first-frame, but the measurement rig was throwaway.
  • Without a repeatable benchmark, any open-path win would silently erode.

What this changes

  • UIProfiler: phase timing (measure/mark) logged to the app log and mirrored as os_signposts, an 8ms main-queue stall watchdog, and a scripted driver (cold open, 12 warm cycles, 10 screen switches, 10 caret toggles, forced refresh, idle soak). Fully inert without the env var.
  • StatusItemController: showPanel/hidePanel phase markers behind the same gate.
  • script/profile_ui.sh: builds, runs the scripted phases, prints the stats summary.
  • docs/debugging.md: how to run it and what the reference numbers are.

Heads-up

  • The stall watchdog measures main-queue latency, not literal dropped frames; the doc spells that out.

Tests

  • UIProfilerTests pins the disabled-by-default behavior and measure pass-through; ran the harness end to end on this branch.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ff4e79aab

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/Runway/Support/UIProfiler.swift Resolved
Comment thread script/profile_ui.sh Resolved
Comment thread script/profile_ui.sh Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c3a711e776

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread script/profile_ui.sh Resolved
Comment thread script/profile_ui.sh Resolved
@mstallone

Copy link
Copy Markdown
Owner Author

Final numbers for the whole stack (#54 → #59), measured with script/profile_ui.sh on the stack tip vs. the pre-stack baseline and upstream openusage's tip (same machine, same accounts; upstream renders ~half our content):

Metric Upstream tip Pre-stack (v0.8.4-dev) Stack tip
Warm open → first frame 42ms 84ms 26ms
Cold open → first frame ~60ms 133ms ~46ms
Warm open/close stalls (12 cycles) 1 24 (1.9s) 0
Screen-switch stalls (10x) 62 (5.8s) 14 (1.9s) 9 (0.7s)
Caret-expand stalls (10x) 28 (1.8s) 37 (3.1s) 12 (0.8s)
Post-close main-thread stall none 70–100ms none (settled in close, ~24ms)

Every local Codex review finding across the stack was addressed with follow-up commits (merged forward, no force pushes).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d226776b7f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/Runway/Support/UIProfiler.swift Resolved
Comment thread Sources/Runway/Support/UIProfiler.swift Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f9a6d4a5c4

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/Runway/Support/UIProfiler.swift Resolved
Comment thread Sources/Runway/Support/UIProfiler.swift Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dc1d7a25a9

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/Runway/Support/UIProfiler.swift Resolved
Comment thread Sources/Runway/Support/UIProfiler.swift Resolved
Comment thread script/profile_ui.sh Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b6295b2964

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/Runway/Support/UIProfiler.swift Resolved
@mstallone
mstallone merged commit 2892e19 into main Aug 2, 2026
2 checks passed
@mstallone
mstallone deleted the perf/ui-01-profiler-harness branch August 2, 2026 07:40
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