Sublime Forum

Git integration - even disabled - insane cpu usage

#1

I’m running 3.2.1 build 3207 on Windows 10 - Since upgrading the CPU usage has been insanely high, maxing out a core i9 processor, and hammering the SSD drive reading the .git directory of my open Project.

I’ll admit it’s a bit of an insane project. The culmination of 5 dev teams working together for 15 years, converted from CVS to SVN to git, it’s hundreds of thousands of files with millions of lines of code and an obscene number of commits. It’s huge, but that should be ok because I have show_git_status and mini_diff set to false in Preferences.sublime-seettings so It shouldn’t be reading my .git directory at all.

Is there any way to stop it? With the best will in the world, it’s not a simple text editor’s place to be doing stuff with source control unless I explicitly tell it to.

0 Likes

#2

If you’ve set show_git_status to false and restarted Sublime Text, then we won’t be reading your git repository.

In general, hundreds of thousands of files is not an issue (I work on a daily basis with over 200k myself). The only time I’ve seen performance issues was with a user who had millions of untracked files, and the issue there was memory usage, not CPU usage. The number of commits will make no difference, as the Sublime Text git integration only concerns itself with the current branch name and the files that have changed between HEAD and the current state of the working copy.

If you are seeing CPU usage, most likely it is either:

  1. Indexing - check the Help > Indexing Status… menu item to see if there is background indexing activity. With every Sublime Text release that includes syntax definition updates, we need to rescan your files to find all function/class definitions. Pretty much every stable release includes fixes and updates to the syntax definitions. We use low-priority background processes to index, and you can control the number of process, and even disable it if you don’t like the Goto Definition functionality. See Preferences and search for “index” for the settings and valid values.
  2. Constant, significant filesystem activity. Sublime Text receives filesystem notifications in order to keep the side bar folder tree up-to-date, and Goto Anything correct. If your machine is constantly adding, modifying and deleting files, this will lead to CPU usage to process the filesystem notifications.
1 Like

#3

According to process monitor the files being read by the sublime text process are all under the .git directory, nothing is currently changing in there.

I use the git cli or in a pinch for a particularly gnarly rebase or something gitkracken as my git client. neither are currently running.

Help > Indexing status says Idle.

0 Likes

#4

Can you post your settings?

Do you see the .git folder in the side bar?

0 Likes

#5

Also, please post the contents of your Console.

0 Likes

#6

Not OP, and unfortunately don’t have time to debug right now, but I upgraded to 3.2.1 this morning and had the same symptoms (including indexing status saying idle). After about 90 minutes of 150% CPU from Sublime, I saw this post and tried setting show_git_status to false. It didn’t help, so I re-installed 3.2.0. On restarting, Sublime indexed for <10 minutes and then returned to normal (low) CPU usage.

Edit: downgrading didn’t help after all. CPU shot up again after ~15 minutes of quiet, and has kept going since. Console says (and keeps saying infinitely):

number of files to index (0) exceeds index_files_sanity_limit (524288), bailing out
0 Likes