Skip to content

perf(web-ui): shorten startup handoff and harden pet sync - #1346

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/perf-startup-resource-observability
Jun 29, 2026
Merged

perf(web-ui): shorten startup handoff and harden pet sync#1346
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/perf-startup-resource-observability

Conversation

@limityan

@limityan limityan commented Jun 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Shorten the startup splash handoff: minimum hold 900ms -> 650ms, exit animation 0.32s -> 0.24s, fallback 450ms -> 350ms.
  • Add a single startup_overlay_hide_start trace point so startup reports can separate "ready to hide" from "overlay removed".
  • Fix performance runner sampling flags (--samples / --iterations) and isolate long-session interaction matrix data under per-run E2E roots.
  • Harden Agent companion pet lifecycle without changing its loading path: the pet component remains on the companion-window startup path, startup sync reads latest AI experience settings at execution time, stale show/hide requests no longer emit stale settings, the pet sends a ready handshake after listeners are registered, and inactive disabled / input settings hide an incorrectly-created pet window.

Performance Data

Release-fast Windows run against latest main baseline 99fd8448, 10 samples each. The claimed product-facing improvement is startup to main UI visible (startup_overlay_hidden). Agent companion changes are correctness hardening and are not counted as a separate performance optimization.

Scenario / metric Before After Delta
Startup to main UI visible (startup_overlay_hidden, median) 1483.4 ms 1027.7 ms -455.7 ms
Non-critical startup done (nonCriticalInitDoneMs, median) 1763.0 ms 1457.7 ms -305.3 ms
Shell interactive ready (interactiveShellReadyMs, median guard) 626.5 ms 493.1 ms -133.4 ms
Main shown to interactive (shownToInteractive, median guard) 211.6 ms 195.3 ms -16.3 ms

Long-session guard on the final build (release-fast, core matrix): first open 170.6 ms, rapid switch 242.6 ms, first scroll 150.8 ms, resize-width 158.3 ms, all with blankEvents=0.

Risk / Scope

  • This does not change LSP, ACP, remote, session hydration, or editor loading behavior.
  • Agent companion pet may still start after the main shell is interactive, but the desktop pet is not deferred out of its own companion-window startup path. The latest config wins if startup sync races with settings or tray changes.
  • The splash can disappear earlier, but still waits for workspaceLoading=false and AppLayout ready, keeps a 650ms minimum hold, and exits via a 240ms animation.
  • The added startup trace is one phase entry only; pet lifecycle hardening adds no verbose logging in normal successful paths.
  • The long-session matrix now writes generated data only to isolated E2E runtime roots and prunes old perf runs.

Validation

  • pnpm run desktop:build:release-fast
  • pnpm run type-check:web
  • pnpm run lint:web
  • pnpm --dir src/web-ui run test:run src/infrastructure/config/services/AgentCompanionWindowService.test.ts src/infrastructure/config/services/AIExperienceConfigService.test.ts src/app/startup/startupPerformanceContract.test.ts src/app/startup/startupOverlay.test.ts src/app/startup/startupPreload.test.ts src/flow_chat/services/AgentCompanionActivityBridge.test.ts src/flow_chat/utils/agentCompanionActivity.test.ts
  • node tests/e2e/scripts/perf-coverage-contract.test.mjs
  • pnpm run e2e:test:perf:startup-stability:release-fast -- --samples 10
  • pnpm run e2e:test:perf:long-session-interactions:release-fast -- --profile core
  • git diff --check

@limityan limityan changed the title perf(web-ui): shorten startup visual handoff perf(web-ui): shorten startup handoff and harden pet sync Jun 29, 2026
@limityan
limityan force-pushed the yanzhn/perf-startup-resource-observability branch from 1a5a1fd to 8ff76d4 Compare June 29, 2026 11:48
@limityan
limityan merged commit ea21fff into GCWing:main Jun 29, 2026
4 checks passed
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