Files
orca/src
Neil ad10cb5b83 perf(store): keep the repo list's identity through workspace hydration (#19057)
* perf(store): keep the repo list's identity through workspace hydration

buildRuntimeSessionPlaceholders opened with `repos.slice()`, so every workspace
session hydration handed the store a brand-new `repos` array — including the
common case where the session referenced no unknown runtime workspace and the
contents were identical. `repos` is selected whole at 46 sites, so each
hydration rerendered all of them for no data change.

The appends below already build a new array rather than mutating, and the
sibling `nextWorktreesByRepo` in the same function was already copy-on-write;
this just gives `repos` the same treatment. No consumer of the returned array
mutates it in place.

* perf(store): keep worktreesByRepo identity through workspace hydration too

addHydratedSshWorktreePlaceholders opens with `{ ...sourceWorktreesByRepo }`, the
same unconditional copy as the repos.slice() above it, in the sibling function the
same hydration calls. A session needing no SSH placeholder is the common case, so
worktreesByRepo got a new identity on every hydration with identical contents.

15 sites select that map whole, the sidebar worktree list among them.

* chore(store): tighten the copy-on-write comments in hydration placeholders
2026-09-06 14:50:05 -07:00
..