You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Updating every 5 seconds is crude; is it good enough? #3
Presently the plugin just spawns a daemon thread that checks every 5 seconds what files and folders should be ignored and shoves them into the appropriate setting in the preferences file. No attempt is made to handle any events triggered by modifying files or settings. This approach has the virtues of:
being really simple
being guaranteed to catch changes regardless of how they are made (in case, for instance, the user is using two text editors in parallel)
However, I have a couple of worries
Is there a risk that this will have a performance impact worth caring about (e.g. in the case of massive repos)?
will that up-to-5s delay between making a change and seeing the settings file update ever prove annoying?
I experience huge performance problems due to this 5 sec check. I got a project with many files dirs and subdirs (keep in mind that node_modules/ and bower_components/ are excluded and are also constantly checked). Sublime hangs for like 2 sec every 5 secs constantly. Why doesn't it check all .gitignore files once per start and then adds a file listener to this file(s) just changing on demand.
I had to uninstall the plugin temporarily.
Should I create a new issue or does this fit into the current one?
Absolutely fits into this one - thanks for the report. I did things this way because I thought it would be good enough and I didn't want to dick around learning how to use file listeners. Sounds like that was a mistake that I now need to solve.
That has its own traps - there are certain methods in the sublime api that fail on windows in sublime text 2 if called from threads other than the main thread. That's why I swapped from using a background thread to using timeouts in c7e735d. But perhaps I can do the expensive stuff in a background thread and then use a timeout to queue only the settings write on the main thread. I'll experiment.
Fie and buggery, I tried the "easier" approach of moving as much as possible onto a daemon thread while wrapping the settings access in set_timeout calls, but it does nothing at all to improve the performance when dealing with large repos. I need to think a bit about why. You can see my failed attempt at a fix at 5fa0fe8 if you're interested.
@hdavidzhu not at present, sorry. I'll try to get round to adding that in at some point. (Feel free to offer a PR if you've got the time and inclination to do so.)
There's really no reason to "watch" the ignored files. How often do you update your gitignore? Just run the command after you made a change and be done with it.
Every 5 seconds, this plugin makes sublime freeze and I get the beachball for about a second. My workaround is to install the plugin, let it run once, uninstall the plugin, and reboot Sublime.
Why not make this a menu option? I should be able to Command-P and run the plugin on-demand instead of having the daemon thing run automatically every 5 seconds.
Activity
ExplodingCabbage commentedon Oct 24, 2014
Just shoved my entire home directory into my project including a dozen git repos and there was no performance problem; I think all is fine.
xilin commentedon Nov 26, 2014
I think it is better if you provide a configuration for how long it is to check.
If there is a manually way to do the check immediately, it is better.
krnlde commentedon Apr 13, 2015
I experience huge performance problems due to this 5 sec check. I got a project with many files dirs and subdirs (keep in mind that node_modules/ and bower_components/ are excluded and are also constantly checked). Sublime hangs for like 2 sec every 5 secs constantly. Why doesn't it check all
.gitignorefiles once per start and then adds a file listener to this file(s) just changing on demand.I had to uninstall the plugin temporarily.
Should I create a new issue or does this fit into the current one?
ExplodingCabbage commentedon Apr 13, 2015
Absolutely fits into this one - thanks for the report. I did things this way because I thought it would be good enough and I didn't want to dick around learning how to use file listeners. Sounds like that was a mistake that I now need to solve.
krnlde commentedon Apr 13, 2015
Thanks man!
krnlde commentedon Apr 13, 2015
2nd easier approach would be to swap the computation on an extra core/thread. Then Sublime wouldn't hang.
ExplodingCabbage commentedon Apr 13, 2015
That has its own traps - there are certain methods in the sublime api that fail on windows in sublime text 2 if called from threads other than the main thread. That's why I swapped from using a background thread to using timeouts in c7e735d. But perhaps I can do the expensive stuff in a background thread and then use a timeout to queue only the settings write on the main thread. I'll experiment.
krnlde commentedon Apr 13, 2015
If it helps https://github.com/jisaacks/GitGutter has a
non_blocking: trueconfiguration flag. Maybe you can use some of these insights.Failed attempt at #3 that doesn't actually help; performance is still…
ExplodingCabbage commentedon Apr 30, 2015
Fie and buggery, I tried the "easier" approach of moving as much as possible onto a daemon thread while wrapping the settings access in set_timeout calls, but it does nothing at all to improve the performance when dealing with large repos. I need to think a bit about why. You can see my failed attempt at a fix at 5fa0fe8 if you're interested.
hdavidzhu commentedon Jul 13, 2015
Is there a way to disable this 5 second update and instead update the listing through a keybinding?
ExplodingCabbage commentedon Jul 14, 2015
@hdavidzhu not at present, sorry. I'll try to get round to adding that in at some point. (Feel free to offer a PR if you've got the time and inclination to do so.)
Narretz commentedon Jul 4, 2016
There's really no reason to "watch" the ignored files. How often do you update your gitignore? Just run the command after you made a change and be done with it.
sffc commentedon Mar 25, 2018
Every 5 seconds, this plugin makes sublime freeze and I get the beachball for about a second. My workaround is to install the plugin, let it run once, uninstall the plugin, and reboot Sublime.
sffc commentedon Mar 25, 2018
Why not make this a menu option? I should be able to Command-P and run the plugin on-demand instead of having the daemon thing run automatically every 5 seconds.