Performance issue in the 'Check for modification', 'Commit', and similar windows when the git index contains a large number of files.
What steps will reproduce the problem?
- Open the "Check for modification" window at the root of a large repository. In my case, more than 300,000 files;
- The window takes about 15 seconds to open, even if there are no changes.
What is the expected output? What do you see instead?
- The window should open faster.
What version of TortoiseGit and Git are you using? On what operating system?
Current stable 2.14.0. Operating system is Windows 11.
Please provide any additional information below.
The problem is that CGit::GetWorkingTreeChanges calls git.exe ls-files -d
, which takes a significant amount of time to execute, even if there are no modified files.
Simply replacing it with git.exe diff --name-only --diff-filter=D
results in a noticeable speed boost. In my case, the window's opening time reduced from 15 to 4 seconds. Merge Request !219 (merged)
I've also tested the old issue #860 (closed). The behavior before and after the modification is the same.
Edited by Sergei Belov