Skip to content

perf(web-ui): defer inactive session metadata startup#1082

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/perf-startup-session-p0-p1
Jun 5, 2026
Merged

perf(web-ui): defer inactive session metadata startup#1082
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/perf-startup-session-p0-p1

Conversation

@limityan
Copy link
Copy Markdown
Collaborator

@limityan limityan commented Jun 5, 2026

Summary

  • Load initial session metadata immediately only for the visible active workspace during startup.
  • Defer non-active workspace session metadata until the startup overlay handoff, with a bounded 0-120 ms stagger and a late-mount next-paint path so sections do not wait for the 10 s fallback after the overlay event has already fired.
  • Make the performance E2E session lookup expand the relevant visible session sections without clicking show less, so older perf fixtures remain reachable in multi-workspace nav state.

Refs #949

Performance data

Environment: Windows desktop release-fast performance E2E on the same local workspace. Current-PR before sample is the pre-change run on gcwing/main/this branch base; after samples are the latest three current-commit release-fast runs.

Scenario Before current PR After current PR Change
Cold startup to interactive_shell_ready 997.1 ms 817.5 ms median -179.6 ms (-18.0%)
Main-window-shown to interactive 165.6 ms 142.2 ms median -23.4 ms (-14.1%)
Before-interactive API total duration 930.9 ms 426.6 ms median -504.3 ms (-54.2%)
Before-interactive list_persisted_sessions_page calls 5 calls 1 call in all latest samples -4 calls

Large-session opening is kept as a regression guard in this PR, not claimed as the main optimization target because the product change is startup metadata scheduling. Latest current-commit guard results:

Scenario Latest current-commit result Notes
First open large history session, latest text readable 377.3 ms median Latest 3 range: 308.9-662.6 ms; the 662.6 ms sample is retained as an outlier to keep investigating.
First open large history session, full history hydrated 1198.7 ms median This remains a residual issue and is tracked in #949.
Warm reopen large history session, latest text readable 262.4 ms median Latest 3 range: 259.1-306.1 ms.
Loading / blank guard while opening large history session loading toggles=0, blank samples=0 Latest samples still record one pre-interaction scroll stabilization event.

Risk and behavior impact

  • Current active workspace behavior is preserved: its visible session metadata still loads immediately.
  • Non-active visible workspace sections now load metadata after startup overlay handoff. This can delay non-active session rows by one paint plus at most 120 ms after first screen handoff, but avoids putting every workspace metadata page into the startup critical window.
  • Existing workspace collapse behavior is not changed; this PR does not collapse older workspaces.
  • Remote workspace parameters continue to flow through the existing metadata API call; this PR only changes when the initial call is scheduled.
  • The new E2E data-session-nav-toggle-action attribute is test-only metadata on the existing show-more button and does not change the user-visible control.

Verification

  • pnpm --dir src/web-ui run test:run src/app/startup/startupPerformanceContract.test.ts src/app/components/NavPanel/sections/sessions/sessionMetadataStartup.test.ts
  • pnpm run type-check:web
  • pnpm run check:repo-hygiene
  • pnpm run desktop:build:release-fast
  • pnpm run e2e:test:perf:release-fast

@limityan limityan merged commit 856434b into GCWing:main Jun 5, 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