Skip to content

perf(sessions): Git diff stats 对全部 Session 做聚合无界的 subprocess fan-out #187

Closed

Description

@tt-a1i

问题

Sessions 列表为了展示 Git diff stats,会按 Session 执行 Git 命令。实现有并发上限,但没有总工作量上限;Session 数增大时 subprocess 数线性增长,并可能对同一 workspace/revision 重复计算。

证据

  • extensions/sessions/git-stats.ts:162-218:按 Session fan-out Git stat 调用;
  • extensions/sessions/git-stats.test.ts:31-36:结构测试中 120 sessions 产生 240 次 Git 调用。

并发限制只控制同时运行数,不降低总 CPU/I/O/进程创建成本。

期望

  • 只为当前可见窗口或明确选中的 Session 计算 stats;
  • 按 canonical workspace + revision/diff identity 去重和有界缓存;
  • 取消/关闭 picker 后停止排队和在途工作;
  • omitted/pending 状态诚实显示,不用错误的 0 files 替代未知;
  • benchmark:10/120/1,000 sessions,包含同 workspace 与多 workspace,记录 subprocess 总数、wall time、取消延迟和 cache hit;总工作应与可见/唯一 key 相关,而不是 Session 总数。

Activity

  1. added
    bug
    on Aug 25, 2026
  2. tt-a1i commented on Aug 28, 2026

    @tt-a1i
    CollaboratorAuthor

    I’m taking this issue. I’ll keep the change scoped to bounded, cancellable Session Git-stat loading; preserve honest pending/unknown UI state; add deterministic 10/120/1,000-session workload coverage; and open a PR after the repository gates and independent reviews are clean.

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions