You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Worktree lookup runs git on the main thread while labels are drawn #647
-worktreePathsByRefName runs git worktree list --porcelain lazily, and the
cache is cleared on every refs reload. The next caller repopulates it, and that
caller is often drawing: PBGitRevisionCell -colorForRef: from -drawLabelAtIndex:, and the sidebar cell from -outlineView:viewForTableColumn:item:. Both are on the main thread, and PBTask waits for the process.
Measured here, 5 worktrees, warm cache, local SSD:
git worktree list --porcelain: median 9.4ms min 9.0ms max 9.9ms
So it is one git process per refs reload, not per row, and under a frame at
60fps in normal conditions. It matters where git is slow to start or the
repository is on a network filesystem, where the first label drawn after each
reload stalls the UI for however long the task takes.
Populating the snapshot off the main thread and having the drawing paths read
the finished result would remove the stall.
Raised by Copilot on #633 and confirmed while reviewing it. Filed separately
rather than fixed there, since the drawing paths predate that PR.
Activity
Stop the worktree lookup stalling the history while it draws (issue g…