-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Commit count: Listing ignored files could hang GE #4328
Commit count: Listing ignored files could hang GE #4328
Conversation
Please update/rebase when you have time. |
Will rebase now when #4327 is merged, the two last commits are applicable |
7a75639
to
9f93e1d
Compare
Rebased without changes.
Repeating from PR description. This is the simplest way and a solution in the same way as normal GE functionality, but this is not the same as this the best way to add more info to GitItemStatus (maybe better to add ~100 lines of duplicated code). |
Thanks
Reading the commit message, you suggest 2.15.1 provides more optimal
behavior.
Will we need to revisit this after adding 2.15.1+ to our setup?
Do we need to add conditional pivots depending on user's git version?
…On 02/02/2018 8:08 AM, "Gerhard Olsson" ***@***.***> wrote:
Rebased without changes.
There are likely better places to optimize (and this PR reduces CPU load
by skipping a separate heavy ls-files), but memory and CPU usage (normally
a few ms) can be improved by skipping ignored by default in
GetAllChangedFilesFromString() and process the ignored separately. I felt
this would make the solution more complex and duplicate code.
Repeating from PR description. This is the simplest way and a solution in
the same way as normal GE functionality, but this is not the same as this
the best way to add more info to GitItemStatus (maybe better to add ~100
lines of duplicated code).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4328 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEMyXlZBhv0ysE10g6daRtkSViRPmOW1ks5tQifZgaJpZM4RVf9_>
.
|
Not saying it is an action item, but typically if to imement something we
need to duplicate code - then we need to refactor and extract the shared
implementation. :)
…On 02/02/2018 8:18 AM, "Igor Velikorossov" ***@***.***> wrote:
Thanks
Reading the commit message, you suggest 2.15.1 provides more optimal
behavior.
Will we need to revisit this after adding 2.15.1+ to our setup?
Do we need to add conditional pivots depending on user's git version?
On 02/02/2018 8:08 AM, "Gerhard Olsson" ***@***.***> wrote:
> Rebased without changes.
>
> There are likely better places to optimize (and this PR reduces CPU load
> by skipping a separate heavy ls-files), but memory and CPU usage (normally
> a few ms) can be improved by skipping ignored by default in
> GetAllChangedFilesFromString() and process the ignored separately. I felt
> this would make the solution more complex and duplicate code.
>
> Repeating from PR description. This is the simplest way and a solution in
> the same way as normal GE functionality, but this is not the same as this
> the best way to add more info to GitItemStatus (maybe better to add ~100
> lines of duplicated code).
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#4328 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AEMyXlZBhv0ysE10g6daRtkSViRPmOW1ks5tQifZgaJpZM4RVf9_>
> .
>
|
2.15.1 can optimize the solution, primarily minimize memory usage. But that will not require many lines of code (most is to detect Git version and to set --ignored=matching, then only ignored directories will be listed). Less memory but higher CPU usage and some corner cases will be ignored (a file that is not ignored in an ignored directory will not trigger an update, but we can live with that corner case).
This solution requires no duplication. Not adding IsIgnored will likely require duplication of GetAllChangedFilesFromString(). |
No command currently requests ignored files (if there was, they would be included with IsNew)
Issue gitextensions#4256 Listing ignored files with a separate "ls-files -o -i --exclude-standard" seem to never exit in some situations, see gitextensions#4256 This reuses the git-status call with --ignored as an option to get the ignored files. (The option is only added when ls-files were called previously.) This call did not seem to hang with many ignored files and the command runtime does not increase much. The solution is not optional though. It still lists all ignored files in memory. The time to find ignored files is faster, but a lot of memory is needed. gitextensions#4256 has some discussions. Also, processing all output to GitStatusItem first before creating the HashSet will require some more memory (temporary) than required.
9f93e1d
to
14429fa
Compare
fixes gitextensions#5439 fixes gitextensions#4256 partly based on gitextensions#5429 The handling was improved in gitextensions#4327, gitextensions#4328, fixing the regression Those PRs limited the max load for git-status Changes: React faster on changing directory (1.0s->0.2s) Some tweaks to the checks, do not check if update is required if an update is already scheduled Do not read ignored files due to two problems: * Reading ignored takes longer times. Since this was done the first time, the first update was delayed. (Reading ignored could be done later, but this will still delay the next update). * Saving all seen ignored files require substantial memory, see gitextensions#4256. The list could be limited (see the issue), but that will increase the test time for ignored files As ignored files will now always trigger git-status may cause some more runs. However, the ignored file list was never complete, the list was better over time, so GE must be able to handle this load anyway.
fixes gitextensions#5439 fixes gitextensions#4256 partly based on gitextensions#5429 The handling was improved in gitextensions#4327, gitextensions#4328, fixing the regression Those PRs limited the max load for git-status Changes: React faster on changing directory (1.0s->0.2s) Some tweaks to the checks, do not check if update is required if an update is already scheduled Do not read ignored files due to two problems: * Reading ignored can takes significant time. Since this was done the first time, the first update was delayed. (Reading ignored could be done later, but this will still delay the next update). * Saving all seen ignored files require substantial memory, see gitextensions#4256. The list could be limited (see the issue), but that will increase the test time for ignored files As ignored files will now always trigger git-status may cause some more runs. However, the ignored file list was never complete, the list was better over time, so GE must be able to handle this load anyway.
fixes gitextensions#5439 fixes gitextensions#4256 partly based on gitextensions#5429 The handling was improved in gitextensions#4327, gitextensions#4328, fixing the regression Those PRs limited the max load for git-status Changes: React faster on changing directory (1.0s->0.2s) Some tweaks to the checks, do not check if update is required if an update is already scheduled Do not read ignored files due to two problems: * Reading ignored can takes significant time. Since this was done the first time, the first update was delayed. (Reading ignored could be done later, but this will still delay the next update). * Saving all seen ignored files require substantial memory, see gitextensions#4256. The list could be limited (see the issue), but that will increase the test time for ignored files As ignored files will now always trigger git-status may cause some more runs. However, the ignored file list was never complete, the list was better over time, so GE must be able to handle this load anyway.
fixes gitextensions#5439 fixes gitextensions#4256 partly based on gitextensions#5429 The handling was improved in gitextensions#4327, gitextensions#4328, fixing the regression Those PRs limited the max load for git-status Changes: React faster on changing directory (1.0s->0.2s) Some tweaks to the checks, do not check if update is required if an update is already scheduled Do not read ignored files due to two problems: * Reading ignored can takes significant time. Since this was done the first time, the first update was delayed. (Reading ignored could be done later, but this will still delay the next update). * Saving all seen ignored files require substantial memory, see gitextensions#4256. The list could be limited (see the issue), but that will increase the test time for ignored files As ignored files will now always trigger git-status may cause some more runs. However, the ignored file list was never complete, the list was better over time, so GE must be able to handle this load anyway.
fixes gitextensions#5439 fixes gitextensions#4256 partly based on gitextensions#5429 The handling was improved in gitextensions#4327, gitextensions#4328, fixing the regression Those PRs limited the max load for git-status Changes: React faster on changing directory (1.0s->0.2s) Some tweaks to the checks, do not check if update is required if an update is already scheduled Do not read ignored files due to two problems: * Reading ignored can takes significant time. Since this was done the first time, the first update was delayed. (Reading ignored could be done later, but this will still delay the next update). * Saving all seen ignored files require substantial memory, see gitextensions#4256. The list could be limited (see the issue), but that will increase the test time for ignored files As ignored files will now always trigger git-status may cause some more runs. However, the ignored file list was never complete, the list was better over time, so GE must be able to handle this load anyway.
fixes gitextensions#5439 fixes gitextensions#4256 partly based on gitextensions#5429 The handling was improved in gitextensions#4327, gitextensions#4328, fixing the regression Those PRs limited the max load for git-status Changes: React faster on changing directory (1.0s->0.2s) Some tweaks to the checks, disable file system monitoring temporary if an update is already scheduled Do not read ignored files due to two problems: * Reading ignored can takes significant time. Since this was done the first time, the first update was delayed. (Reading ignored could be done later, but this will still delay the next update). * Saving all seen ignored files require substantial memory, see gitextensions#4256. The list could be limited (see the issue), but that will increase the test time for ignored files As ignored files will now always trigger git-status may cause some more runs. However, the ignored file list was never complete, the list was better over time, so GE must be able to handle this load anyway.
Should be reviewed together with #4327, this PR is based on #4327 even if the changes can be separated.
Issue #4256
Listing ignored files with a separate "ls-files -o -i --exclude-standard" seem to never exit in some situations, see #4256
This reuses the git-status call with --ignored as an option to get the ignored files. (The option is only added when ls-files were called previously.) This call did not seem to hang with many ignored files and the command runtime does not increase much.
The solution is not optional though. It still lists all ignored files in memory. The time to find ignored files is faster, but a lot of memory is needed. #4256 has some discussions.
Also, processing all output to GitStatusItem first before creating the HashSet will require some more memory (temporary) than required.
There are likely better places to optimize (and this PR reduces CPU load by skipping a separate heavy ls-files), but memory and CPU usage (normally a few ms) can be improved by skipping ignored by default in GetAllChangedFilesFromString() and process the ignored separately. I felt this would make the solution more complex and duplicate code.
It would be more efficient from memory usage (some CPU hits) to use the Git 2.15.1 option --ignored=matching, but a fallback solution (at least) is needed.
Changes proposed in this pull request:
What did I do to test the code and ensure quality:
Has been tested on (remove any that don't apply):