Skip to content

More repo info telemetry check to support windows repo perf issues#4339

Merged
zhichli merged 5 commits intomicrosoft:mainfrom
IanMatthewHuff:dev/ianhu/moreTelemetryChecks
Mar 12, 2026
Merged

More repo info telemetry check to support windows repo perf issues#4339
zhichli merged 5 commits intomicrosoft:mainfrom
IanMatthewHuff:dev/ianhu/moreTelemetryChecks

Conversation

@IanMatthewHuff
Copy link
Copy Markdown
Member

@IanMatthewHuff IanMatthewHuff commented Mar 10, 2026

More follow up to: #3774

The configuration of certain windows repos is still having perf issues after the change above. With help from a windows dev the most probably issues were seen as:

  1. The configuration of virtualfilesystem and sparsecheckout causing issues with calculating diffs:
    Skip repo info diff for VFS and sparse checkout enlistments #4308

  2. Enough extensive local commits created (especially with renames) that just calculating the number of diffs in the change slows down vscode with expensive git processes
    Skip repo info diff when commit count exceeds limit #4309

For this date our usual thing is to prioritize avoiding nasty perf issues at the expense of possibly dropping some data, so I'm implementing both changes here. I also do believe that in most cases of the commit count check we'd be pushing on too big a diff to log in telemetry in any case possibly. As with the other change we are logging why we don't check telemetry so if we start to not even enough events through we can re-examine.

Unit tests also updated.

For my local testing I did the following tests with a local build:

  • Events fired for a standard scenario
  • Too old event fires for >30day old diff
  • Does not collect and logs 'virtualfilesystem' with core.virtualfilesystem or core.sparsecheckout specified
image
  • Does collect after those settings are turned off in the repo
  • Collects after 25 local commits from upstream are added
  • Does not collect after 10 more local commits are added and logs 'tooManyCommit'
image
return skipDiffResult('virtualFileSystem');
}
} catch {
return skipDiffResult('virtualFileSystem');
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all these err on the side of not collecting if we can't calculate the check we are doing.

@IanMatthewHuff
Copy link
Copy Markdown
Member Author

@tyrielv for context from the windows side. Thanks for providing the diagnosis info.

@zhichli for context from vscode / repo info side and for review / merge help. Much appreciated!

@IanMatthewHuff IanMatthewHuff marked this pull request as ready for review March 10, 2026 21:18
Copilot AI review requested due to automatic review settings March 10, 2026 21:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds additional early-exit checks to first-party repo diff telemetry to avoid expensive Git operations in known slow Windows repo configurations (VFS/sparse checkout and large local commit ranges).

Changes:

  • Skip repo info diff telemetry when core.virtualfilesystem or core.sparsecheckout is configured (or config lookup fails).
  • Skip repo info diff telemetry when the commit range between merge-base and HEAD reaches a configured maximum.
  • Extend unit tests to cover the new skip conditions and update repo mocks with getConfig/log.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/extension/prompt/node/repoInfoTelemetry.ts Adds VFS/sparse-checkout and commit-count guards to skip costly diff collection.
src/extension/prompt/node/test/repoInfoTelemetry.spec.ts Adds new test coverage for the guard conditions and updates repository mocks accordingly.
try {
const virtualFileSystem = await repository.getConfig('core.virtualfilesystem');
const sparseCheckout = await repository.getConfig('core.sparsecheckout');
if (virtualFileSystem === 'true' || sparseCheckout === 'true') {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

core.virtualFileSystem isn't necessarily a boolean. If it has any truthy (for C-definition of truthy) value then it is enabled.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"true" is used sometimes, but typically only in unit tests. Real repositories will have it set to the path of a hook so git can talk to the VFS.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

core.sparsecheckout should also be truthy - I see examples of both "true" and "1" for it in the git source code.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it looks like virtualFileSystem is just if it's specified, but sparse checkout is actually this https://git-scm.com/docs/git-config#Documentation/git-config.txt-boolean ? Looks like vscode's git extension doesn't do any type of type coercion there. So ['yes','true','on','1'] looks like the set to me, case insensitive. Was honestly a bit hard to tell from the docs exact what sparsecheckout was for sure, but I always saw enable and disable used to describe it, and since true and 1 mentioned went with the git boolean defintion.

Copy link
Copy Markdown

@tyrielv tyrielv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for following through!

@zhichli zhichli requested a review from sbatten March 12, 2026 16:51
@vs-code-engineering vs-code-engineering bot added this to the 1.112.0 milestone Mar 12, 2026
@zhichli zhichli added this pull request to the merge queue Mar 12, 2026
Merged via the queue into microsoft:main with commit 6cb1a7a Mar 12, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

6 participants