New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Constant repository polling for changes #4069
Comments
Do you get the same with FileSystemWatcher enabled? A source comment in ToolStripGitStatus mentions that the command should run every 5 min or at changes. I cannot see any obvious flaws. I do not see the constant polling, with or without FileSystemWatcher. But repos are quite small. Edit: One thing in common seem to be that commands seem duplicated, often appears in identical pairs. |
I hadn't investigated the source in details, my current understanding that "Show number of changed files on commit button" enables the FileSystemWatcher. Our repo is large (5+ years, 90 projects in a solution). I think whenever the source is getting compiled and processed by VS/grunt, filesystem i/o set the watcher off like crazy... I've noticed the log duplication too. Not too concerned with that atm. |
While I have not seen so high CPU usage, the handling with many submodules is a little slow (this is still a good feature in GitExtensions). The FileSystemWatcher option AppSettings.UseFastChecks seem to be an additional service that set an exclamation mark on the refresh button when the file system has changed. There does not seem to be much overhead here. The RevisionGrid is otherwise updated when GE has done operations that affect the index. There is also a FileSystemWatcher in ToolStripGitStatus Settings.ShowGitStatusInBrowseToolbar, controlled by "show number of changed files on commit button". The purpose is to update the counter. This will run "git status" at every file change or every fifth minute. There is a deferred delay of 500 ms when Git operations start, but if there are continuous changes to the file system, the check can run more or less continuous too. The "git status" check can take quite some time. The GE repo is not that big but with many submodules, it could be slow. A discussion to improve the functionality:
As a temporary workaround, the FileSystemWatcher can be used to give the exclamation mark when there are file changes.
|
…use FileSystemWatcher) is activated This change originates in gitextensions#4031 but can also be used as a workaround for limitations due to gitextensions#4069
…use FileSystemWatcher) is activated This change originates in gitextensions#4031 but can also be used as a workaround for limitations due to gitextensions#4069
Update: Will probably not go into caching of "dynamic" commands, it will have too much impact on for instance testing. I propose this handling is improved in a way that many can benefit from the changes. Discussed in other issues too Brief proposal:
|
I tried to debug why the same command seem to be logged two times. It does not seem to be called twice, it seems to be that the logger in GitCommandHelpers.cs StartProcess fires Exited twice, with the same information. For the performance problem, I have added a delay until next command start, but it will not change the situation much if git status requires 1,5s. So the "solution" is probably a setting "max time to update the Commit count at file system changes". Default set to 10s or so? |
To be honest, I haven't had time to give it any thought... |
I only saw crude fixes. As I found no other reports with this problem (only slightly different), there should be a real explanation. |
I see dup logs on all my systems....
As for the long execution - I think it is a problem with our work laptops.
…On 06/12/2017 5:52 PM, "Gerhard Olsson" ***@***.***> wrote:
How easy is it to fix the dup logs?
I only saw crude fixes. As I found no other reports with this problem
(only slightly different), there should be a real explanation.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4069 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEMyXlw8P0_pIskiIH0GoBuVk0QvTxBaks5s9jm0gaJpZM4P-qVh>
.
|
So do I. I plan look at this again later.
The virus program most likely. |
This one isn't particularly high on my todo list, there are few other items of much higher value to our users (mainly UX related). |
…ent selection is lost Improves/resolves gitextensions#4069 where file system is constantly updated and git-status is slow
A proposal based on #4209, will submit PR when merged |
Reported in gitextensions#4069 Based on changes in gitextensions#4209 GE can in some situations use a lot of CPU and disk load, as it runs "git status --untracked-files" at changes in the filesystem If a status command is not done before next update is detaected, the next start immediately after. "git status" can therefore run continuously. (This is more visible with certain viruses like Symantec and McAfee.) This PR limits the checks in two ways: * First run is started after 1000 ms + timer (average 250ms) instead of 500+timer, to collect more changes (probably not essential) * Next command is started minimum 5000ms after the previous command. So normal one shot changes are detected about the same as now, but continuous changes are not updating so frequently. A few other changes like that the "next run" time could be overwritten by a time in the future and that retrieved "git status" data were not used if more file system changes were detected. If "git status" requires more than 5s to run, the behavior is not improved. The counter in the Commit button should not be used then. Configurable time could improve (like longest of 5s and twice the time to run git status), configurable time is not going to be used. There are situations where the "ignored files detection" is insufficient. See gitextensions#4256 for a discussion.
Reported in gitextensions#4069 Based on changes in gitextensions#4209 GE can in some situations use a lot of CPU and disk load, as it runs "git status --untracked-files" at changes in the filesystem If a status command is not done before next update is detaected, the next start immediately after. "git status" can therefore run continuously. (This is more visible with certain viruses like Symantec and McAfee.) This PR limits the checks in two ways: * First run is started after 1000 ms + timer (average 250ms) instead of 500+timer, to collect more changes (probably not essential) * Next command is started minimum 5000ms after the previous command. So normal one shot changes are detected about the same as now, but continuous changes are not updating so frequently. A few other changes like that the "next run" time could be overwritten by a time in the future and that retrieved "git status" data were not used if more file system changes were detected. If "git status" requires more than 5s to run, the behavior is not improved. The counter in the Commit button should not be used then. Configurable time could improve (like longest of 5s and twice the time to run git status), configurable time is not going to be used. There are situations where the "ignored files detection" is insufficient. See gitextensions#4256 for a discussion.
Reported in gitextensions#4069 GE can in some situations use a lot of CPU and disk load, as it runs "git status --untracked-files" at changes in the filesystem If a status command is not done before next update is detected, the next start immediately after. "git status" can therefore run continuously. (This is more visible with certain viruses like Symantec and McAfee.) This PR limits the checks in two ways: * First run is started after 1000ms + timer (fires every 500ms so adds on average 250ms) instead of 500ms +timer, to collect more changes (probably not essential) * Next command is started minimum 3000ms after the previous command. If 3*time to run the status update is longer than 3000ms, the interval time is dynamically increased. So normal one shot changes are detected about the same as now, but continuous changes are not updating so frequently, "git status" should not run continuously. A few other changes like that the "next run" time could be overwritten by a time in the future and that retrieved "git status" data were not used if more file system changes were detected. If "git status" requires more than 5s to run, the behavior is not improved. The counter in the Commit button should not be used then. Configurable time could improve (like longest of 5s and twice the time to run git status), configurable time is not going to be used. There are situations where the "ignored files detection" is insufficient. See gitextensions#4256 for a discussion.
Reported in gitextensions#4069 GE can in some situations use a lot of CPU and disk load, as it runs "git status --untracked-files" at changes in the filesystem If a status command is not done before next update is detected, the next start immediately after. "git status" can therefore run continuously. (This is more visible with certain viruses like Symantec and McAfee.) This PR limits the checks in two ways: * First run is started after 1000ms + timer (fires every 500ms so adds on average 250ms) instead of 500ms +timer, to collect more changes (probably not essential) * Next command is started minimum 3000ms after the previous command. If 3*time to run the status update is longer than 3000ms, the interval time is dynamically increased. So normal one shot changes are detected about the same as now, but continuous changes are not updating so frequently, "git status" should not run continuously. A few other changes like that the "next run" time could be overwritten by a time in the future and that retrieved "git status" data were not used if more file system changes were detected. If "git status" requires more than 5s to run, the behavior is not improved. The counter in the Commit button should not be used then. Configurable time could improve (like longest of 5s and twice the time to run git status), configurable time is not going to be used. There are situations where the "ignored files detection" is insufficient. See gitextensions#4256 for a discussion.
* Limit how often GitStatus polls for changes Reported in #4069 GE can in some situations use a lot of CPU and disk load, as it runs "git status --untracked-files" at changes in the filesystem If a status command is not done before next update is detected, the next start immediately after. "git status" can therefore run continuously. (This is more visible with certain viruses like Symantec and McAfee.) This PR limits the checks in two ways: * First run is started after 1000ms + timer (fires every 500ms so adds on average 250ms) instead of 500ms +timer, to collect more changes (probably not essential) * Next command is started minimum 3000ms after the previous command. If 3*time to run the status update is longer than 3000ms, the interval time is dynamically increased. So normal one shot changes are detected about the same as now, but continuous changes are not updating so frequently, "git status" should not run continuously. A few other changes like that the "next run" time could be overwritten by a time in the future and that retrieved "git status" data were not used if more file system changes were detected. If "git status" requires more than 5s to run, the behavior is not improved. The counter in the Commit button should not be used then. Configurable time could improve (like longest of 5s and twice the time to run git status), configurable time is not going to be used. There are situations where the "ignored files detection" is insufficient. See #4256 for a discussion.
Closing due to age. |
Do you want to request a feature or report a bug?
bug, related to some extent to #3836 and #3774.
What is the current behavior?
When "Show number of changed files on commit button" is enabled GE is constantly invoking
git status --porcelain -z --untracked-files
which has a significant performance impact for large repos. Git processes are constantly kicked off and those typically spike CPU usage by 20-30%.If "Show number of changed files on commit button" is disabled the problem seems to go away, however it is a workaround not a solution to the problem.
What is the expected behavior?
Polling for changes should be configurable and perhaps have some sort of a throttling mechanism
Environment you encounter the issue:
Did this work in previous version of GitExtensions (which)?
I have seem it in 2.4x versions
The text was updated successfully, but these errors were encountered: