Skip to content

perf(window): close paths, Cloud SQL key folder and gated items left from #4431 #4453

Open

Description

@datlechin

Follow-up to #4431 (perf audit, lifecycle lane). Items left out of that PR:

  • L6, Cloud SQL key files in their own folder (21d): cut. Two security review rounds found that an older build run after the upgrade can leave a service account key in $TMPDIR that a once-per-install sweep never lists again (a crash during proxy startup writes the key before its PID record). Main still lists all of $TMPDIR at every launch, in the background (72 to 75 ms CPU at 24,983 entries on the audit Mac, 4,578 here), and again at quit on the main thread. Needs a design that still catches keys an older build writes later.
  • L7, lazy agent session engines: shipped on the pass 1 gate (500 sessions +4.4 MB, +28 ms main CPU over 6 connections). After: +0.59 MB over base, plan target under 0.3 MB, n=1. 50 sessions not run. Re-measure 0, 50 and 500 in quiet pass 2.
  • L1, close paths: only the close button path is measured (windowcycles, 0 coordinators, workspaces and split views after 20 closes). The closepaths scenario (Cmd-W twice, Close Connection, rail close, disconnect and reconnect x5) is not in the suite yet. Quiet pass 2.
  • L1, release test: checks the coordinator, the actions and the panes, not the NSWindow. The unit test host keeps closed windows in an autorelease pool it never drains, so only the memory bench sees the window go.
  • L2, Option-click: a window with no browse content (Agent mode while still connecting) asks with its own sheet, not inside the one Review Changes alert.
  • L3, pooled leases reusing the session's Keychain answers (12 fewer reads per open table): belongs with finding 5. Production Keychain cost (launch --production) not measured; needs the bench account.
  • L5: measured on 1,000 and 10,000-row pages only (--quick); the 100,000-row page is quiet pass 2.
  • L8: older conversations in a deleted connection's history list stay; D21 covered its sessions and their transcripts.
  • 21c, NULL display setting: fixed by feat(settings): native macOS Settings sidebar with pushed pages and history #4413. The nulldisplay scenario needs its field locator fixed before quiet pass 2 can confirm 0 didSet hits per key.

Quiet pass 2 results will be added here.

Activity

  1. added
    enhancement
    platform-macos
    on Nov 23, 2026
  2. datlechin commented on Nov 24, 2026

    @datlechin
    MemberAuthor

    Quiet pass 2, partial (main d9b6120): L7 stored agent sessions, Welcome footprint and main CPU to first frame: 0 sessions 62.34 MB / 340.7 ms, 50 sessions 62.69 MB / 345.9 ms, 500 sessions 63.44 MB / 351.9 ms. Cost per stored session is about 2 KB and 0.02 ms. L5 (Cmd+A on 100k rows) runs in the rest of the pass.

  3. datlechin commented on Nov 24, 2026

    @datlechin
    MemberAuthor

    Quiet pass 2 (not quiet, load up to 27): L5 Cmd+A on a 100,000-row page, base 337.9 ms / 6594 Minstr, main 27.3 ms / 228 Minstr. L7: main 0/50/500 sessions 45.3 / 46.1 / 64.6 MB, 574 / 570 / 585 ms to first frame (rows starred, noisy).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementplatform-macos

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions