Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

cache storage path
amo11
#1 Posted : Monday, October 7, 2024 9:52:19 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 11/9/2021(UTC)
Posts: 6
Location: Denmark

Thanks: 1 times
I had NCrunch show a warning today, seemingly at random, about use of the Microsoft Git Provider in Visual Studio (see below). The stackoverflow post it referred to was quite old (circa 2014), and a lot of the information seemed to be out of date.

I checked my configuration in Visual Studio 2022, which only listed "Git" as the source control plug-in (from Tools | Options | Source Control | Plugin Selection). I have git installed via the winget package Git.Git, and I do not have the Visual Studio component Git for Windows installed.

Given this, the warning seemed strange to me, as the language in the warning seemed specific to Git for Windows.

I decided to see if changing the cache storage path would have an effect. I set the NCrunch cache storage path for this solution to "D:\NCrunchCache". NCrunch was able to use this path, and I saw an immediate and significant boost in performance. Test runs are now being completed very fast, and the warning has disappeared.

I am now wondering
- am I correct in assuming that the warning is (or was) intended only for Git for Windows?
- is there is a general problem with Windows + file system changes in large git repositories + all git providers causing constant rescans?
- is it ok to use a hard coded path for the NCrunch cache storage path, as your documentation refers only to relative paths or using environment variables (e.g. %temp%)?

Thanks in advance


warning text from NCrunch:

Quote:
The Microsoft Git Provider has been detected as resident in the VS IDE, and this solution is part of a large git repository containing many entries.

The MS Git Provider has a performance issue that causes it to constantly re-scan the entire repository when file system changes are detected anywhere underneath the repository root or in nested directories. This problem exists regardless of how Git is configured with .gitignore files, and is responsible for high CPU consumption in the IDE on solutions with large Git repositories.

Because NCrunch often updates files within its own cache directory (_NCrunch_SOLUTIONNAME), it can act as a continuous trigger for this performance problem.

If you are not actively using the Microsoft Git Provider, it is strongly recommended that you remove it from your system. It is possible to disable this extension through Visual Studio's 'Tools->Options-Source Control' setting, but the extension very often re-enables itself silently at a later date. To permanently remove this extension, see https://stackoverflow.co...t-git-provider#23512676

Alternatively, you can move the NCrunch cache storage directory outside of the Git repository path by using the 'NCrunch cache storage path' solution-level NCrunch configuration setting. This will prevent NCrunch from directly triggering the performance issue, though it may still appear in response to file system activity caused by other processes.

Click here to hide this warning
Remco
#2 Posted : Monday, October 7, 2024 11:24:06 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,122

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Hi, thanks for posting.

This warning was introduced a number of years ago when I discovered a performance issue in the VS Git provider that was hammering NCrunch. At the time, their Git provider was still in its early days of development, but it was in the default installation of VS and would enable itself without any action necessary from the user. So I warned people about it because I couldn't do anything else.

I believe they resolved this problem in later versions. I can't say where the change happened, but I do know that it's possible now to install VS and not have its performance fall through the floor without disabling the Git provider.

My own analysis of the issue stopped at assessing its impact and which library was responsible. The detection works by checking the assemblies loaded into the IDE. If the assembly 'LibGit2Sharp' is loaded, and the solution has a large Git index, the warning is shown. My expectation is that MS are no longer using this library by default, so most people never see the warning and never experience the problem. Probably you have installed something that is making use of this library inside the IDE, and as such the problem has appeared for you.

amo11;17650 wrote:

- is there is a general problem with Windows + file system changes in large git repositories + all git providers causing constant rescans?


I cannot answer this with certainty, other than to say that having LibGit2Sharp running inside devenv.exe seems to be bad.

amo11;17650 wrote:

- is it ok to use a hard coded path for the NCrunch cache storage path, as your documentation refers only to relative paths or using environment variables (e.g. %temp%)?


Yes, you can. The cache storage path doesn't need to be relative, and it shouldn't be checked into your VCS anyway. Most people usually like to have it relative because they often share their settings with others via VCS, and having absolute paths stored there is generally not seen in good light.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.034 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download