Skip to content

perf: Investigate reducing RSS / working-set footprint #645

Closed

Description

@omesser

Problem

Short cross-OS RSS baselines from #600 show a large physical footprint for a single Instance:

OS Setup Total (short run: 5s settle / 30s sample)
Linux (Grok Bot box) 1× bmo:One, 1 display RSS min 821 / median 823 / max 933 MB (4 processes: ai-buddy + WebKit helpers)
Windows (DESKTOP-UQIE144) 1× bmo:One, 2 displays Working set min 607 / median 612 / max 620 MB
macOS (#590 / research doc) 1 Instance, 2 displays Peak physical footprint ~504–583 MB across processes (longer settle/sample than the Linux/Win shorts)

Sources: PR #600 (merged), docs/research/memory-rss-and-multi-monitor.md, scripts bench-rss-{macos,linux,windows}.*. Parent measurement issue: #424.

This issue is not “add more benches.” It is: find and cut real cost so a one-Instance buddy is not hundreds of MB of RAM by default.

What we already know (from the research doc / #590 / #600)

  • Cost is dominated by webview / renderer processes, not a huge Rust engine heap.
  • On macOS, footprint tracks pixels (display resolution) more than display count; Instances add webview cost.
  • Character packages are large base64 payloads loaded at startup (macOS research notes ~4.5 MB packages contributing).
  • Linux short-run median (~823 MB) is higher than the Windows short-run median (~612 MB) and macOS peaks in the research doc — toolkit differences (WebKitGTK vs WebView2 vs WKWebView) matter; do not assume one OS’s cut applies unchanged.

Investigate (hypotheses — verify, don’t assume)

  1. Startup / asset loading — defer or slim character package decode; avoid loading every Character when only one Instance is up.
  2. Webview configuration — shared process model, fewer helper processes, smaller backing stores, disable unused WebKit/Chromium features.
  3. Overlay / Chat / Settings surfaces — idle surfaces that still keep a live webview resident.
  4. Per-display / per-Instance accounting — confirm whether Linux’s high short-run number is settle noise, debug-build overhead, or structural (re-run with --research / Release if needed for fair comparison).
  5. Debug vs Release — perf: Add Linux and Windows RSS baseline scripts #600 smokes used debug binaries; quantify Release before prioritizing cuts.

Out of scope for this issue

Acceptance (when someone picks this up)

  • Named costs with before/after numbers from scripts/bench-rss-*.sh|ps1 on at least one OS (same scenario as perf: Add Linux and Windows RSS baseline scripts #600’s one-Instance short run, plus Release if debug was the confounder).
  • Doc note in docs/research/memory-rss-and-multi-monitor.md (or a short follow-up) for what changed and what remains.

— Cursor agent (Coder), on @omesser's behalf.

Activity

  1. added
    needs-triageMaintainer needs to evaluate this issue
    performanceCPU/GPU/memory/idle cost and benchmarking
    researchDefining or executing a research into an aspect: tech, direction, decision
    on Sep 12, 2026
  2. added this to the V1 milestone on Sep 12, 2026
  3. moved this from 👷 Todo to 🙋 Human Triage in Fidgeton Sep 17, 2026
  4. omesser commented on Oct 1, 2026

    @omesser
    OwnerAuthor

    Shipped on main via #1212 (63368664).

    What landed

    • Linux taskbar Settings anchor is a GTK window (no second WebKit webview).
    • One-Instance short release bench: 4→3 processes; summed RSS median 858→585 MB (PSS ~501→381 MB).
    • Research note updated: docs/research/memory-rss-and-multi-monitor.md (release baseline vs debug, discarded hypotheses, before/after table).

    Acceptance

    Remainder (separate job)

    • Windows WebView2 taskbar anchor still unmeasured / unchanged → tracked in #1218.
    • Parent measurement plan #424 left open on purpose.

    Closing as completed matches the merge keyword; leaving this closed.

    — Cursor agent (Coder), on @omesser's behalf.

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

    needs-triageMaintainer needs to evaluate this issueperformanceCPU/GPU/memory/idle cost and benchmarkingresearchDefining or executing a research into an aspect: tech, direction, decision

    Projects

    • Status
      Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions