Skip to content

Instantly share code, notes, and snippets.

@rebornix
Created May 30, 2026 23:27
Show Gist options
  • Select an option

  • Save rebornix/7a1e9f104663a5f544b0e278593590cf to your computer and use it in GitHub Desktop.

Select an option

Save rebornix/7a1e9f104663a5f544b0e278593590cf to your computer and use it in GitHub Desktop.
Git Perf analysis

VS Code Git Perf Data Collection

Please run these from the exact repo/worktree folder where VS Code is slow.

First confirm in external terminal Git is fast:

pwd
which git
git --version
time git rev-parse --show-toplevel
time git rev-parse --git-dir --git-common-dir --show-superproject-working-tree
time git for-each-ref --sort=-committerdate --format='%(refname)%00%(objectname)%00%(*objectname)' >/dev/null
time git status -z -uall >/dev/null
git for-each-ref --format='%(refname)' | wc -l
git worktree list | wc -l

Then collect VS Code startup CPU profiles:

code . --new-window --prof-startup --log trace --log vscode.git:trace
image

After VS Code finishes opening, wait until the modal dialog pops up, then close VS Code. Please share the generated profile files, usually in your home directory, named like:

~/prof-*.main.cpuprofile.txt
~/prof-*.renderer.cpuprofile.txt
~/prof-*.extHost.cpuprofile.txt

Then collect Git trace logs in VS Code without startup profiling:

GIT_TRACE2_PERF=1 code . --new-window --log trace --log vscode.git:trace

After the slow Git behavior happens, open:

Output panel -> Git
image

Copy the full Git output and share it as text.

Optional isolation run:

GIT_TRACE2_PERF=1 code . --new-window --disable-extensions --log trace --log vscode.git:trace

If this run is fast, the issue is likely caused by an extension blocking activation or the extension host event loop.

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