Sublime Forum

Sublime Text 3 is very slow

#1

I was using Sublime Text 2 for about a year and I decided it was time to upgrade. It was all good until I started to compile my project which uses 100% of my CPU. If I try to do something as trivial as entering a single letter into Text 3, there is a huge delay which sometimes lasts few seconds. I’m not even talking about opening file search dialog (CMD+P) which is even slower at times.

I don’t know what changed from Text 2 to Text 3, but this problem is not present in Text 2. While my computer is not the fastest thing on the planet, I can browse the web and use other file editing software with no problems (including Text 2) when my project is being compiled using full CPU.

Does anyone have any suggestions?

0 Likes

#2

Which version of Sublime Text 3 did you install? 3103 or 3111? 3111 has some rendering speed improvements which may help.

0 Likes

#3

My version is 3103. I will try the newer version and come back here.

0 Likes

#4

Ah, seems like I cannot use that build without having a license :frowning:

0 Likes

#5

Do you have a license for v2? If so, that is valid for v3 while v3 is still in “beta”.

0 Likes

#6

I observe the same problem. Sublime Text 3 is essentially unusable (all versions) during a build (during which most of my cores are in use). It appears to be caused by indexing of symbols, since disabling that feature makes the problem go away and speed returns to normal. However, I rely on symbol lookup so rather than disable it, I edit in Atom or BBEdit while a build is going on, then use Sublime Text the rest of the time.

And yes, Atom and BBEdit both run at quite acceptable speeds while my machine is performing a build. But neither automatically indexes symbols.

This is the only instance of poor performance in Sublime Text that I have seen, but it is rather debilitating. I hope for an update that throttles symbol indexing when the machine is too busy to allow good editing performance.

And yes I have a license and I have observed this problem for a long time, through many versions of ST 3. I am presently using build 3103

0 Likes

#7

You probably want to do few things:

  1. Use the latest dev build to get the latest syntax definitions, which we’ve be rewriting/improving to use the new regex engine, which indexes faster/with less CPU, and indexes more accurately
  2. Use the index_exclude_patterns to exclude your build dir or temp files from indexing
  3. Set index_workers to a number less than the number of cores on your machine
0 Likes

#8

Yeah, but they don’t want to pay. :laughing:

0 Likes

Sublime unusable over X11 on gigabit LAN (scrollbar transparency related?)
#9

Thank you. I’ll try the latest build and setting index_exclude_patterns to exclude temp files (mainly have some SWIG-created files that can ge huge that I don’t want indexed). That is a great suggestion.

I assume ST 3 does not try to index libraries (.os, .so and .dylib) but if those should be added to the exclude pattern list please let me know. Our build system does not segregate build files into their own directory, but I think the temp files primarily consist of the libraries and SWIG-generated files, so I probably can catch them all via file name patterns.

I will limit cores if the above don’t work. ST certainly cranks up the fans while indexing, and if the machine isn’t doing anything else then I’d rather allow ST to have those cores. But I wish ST would automatically throttle the indexing if the machine was busy. Responsive editing is more important than indexing!

1 Like

#10

I found that on a four core laptop, setting index_workers to 2 significantly helps, and I am working on syntaxes all day long. With the syntaxes, each time you save it reindexes everything, so I’m a pretty heavy user of the indexing features. Leaving the auto-detection of index workers definitely makes the fans spin when I have the Sublime Text project open.

0 Likes

#11

Thank you again. I will take your advice and also limit the number of cores. If nothing else, I’ll be nice not to have the fans spin up while making the index.

0 Likes

#12

I have been having this issue for a long time and decided to not use Sublime anymore. The issues resulted in characters getting swapped while typing and other severe issues.

I am now at a new company with a brand new computer and decided to give it another try.
When indexing files I have 4 running processes at 68%. Fans running full speed on a brand new MBP 15’’. This can happen at random times and often lasts for half an hour or even the entire day.

I have 3 plugins installed but Sublime is already unusable. I am pretty sure there is a huge bug in Sublime which nobody cares about.

I think it is really sad that I paid for this app but this issue was never resolved. I actually reported it a while back and got no response at al.

I do not understand this issue and also cannot accept it since it causes errors and costs time while working.

Seems I have to put sublime in the trash for good and accept that I wasted my money.

There is no real fix for this and the suggestions made to fix this makes no sense.

Why do I have to hide folders that I want to see to make Sublime usable?

Why does Atom, or Emacs not have these issues.

Maybe it would be better to explain the origin of this issue than suggesting to hide folders until Sublime is happy

0 Likes

#13

Did you read the comments above about the index_workers setting?

Those four processes are indexing all of the code you have in your project so you can jump around files to the definition of a given class, function or other data structure without knowing what file it is in. If you never use Goto Definition (you should try it for a couple of days to see how useful it is), then you can turn off indexing and the indexers will never run.

With indexing on, you can use index_workers and set it to 2 to only use two indexing processes. In really large projects with a laptop this can help prevent spinning up your fans. By default the indexer uses all the CPU you have to index most quickly. Desktop users tend to have better cooling, and probably won’t notice a fan uptick.

The index is generated once, and then updated incrementally as files change, or when the syntax defs are updated (such as with a new build of Sublime Text). So those processes won’t be there forever.

Let me know if you have any other questions.

0 Likes

#14

Sorry I should have mentioned that I followed the comments and the issues were not resolved. Per default it uses 4 workers but even when I set it to 2 the fans get extremely loud and the indexing is slowed down so much that it basically never stops (resulting in the mentioned daylong fan blowing)

This happens in my fully configured Sublime on my personal MBP and on the MBP from work which has basically no config.

The only solution that helped me so far was using
“folder_exclude_patterns” extensively with different project structures.

0 Likes

#15

You could lower the indexers to 1 to reduce the process to a single worker. Obviously the indexing will take longer, but I’ve never experienced the fan in my 2013 MBP kicking on when just a single process (core) is using 100% CPU.

You mention the indexing never stops. Can you give me a sense of how long indexing takes if you let it run? Also, what are the primary languages used in your project? I’ve got about 60k files, mostly C++ and Python, on a 2013 MBP with 2 index workers and indexing can take a couple of minutes.

If you let it finish, do you end up seeing it restart again right away? Do you see any errors in the console about indexing? Once indexing is complete, it should only need to regenerate when files are edited, or the syntax definitions for Sublime Text change (such as after installing a new build).

0 Likes

#16

I in fact tested it on my own computer when I wrote the last comment. I saved a few files and looked through some folders and the fans went crazy. The indexing takes about 2 - 4 minutes with 2 cores in a big but not insanely huge project. Though we are taking about 80k+ files if I don’t exclude certain folders. I had one instance today where it restarted 3 times (no console output at all) and I decided to close the window.

I have had extreme problems with symbolic links and also with opening different folders in different windows in older versions.
Both were failed workarounds to the initial problem and I moved back to a different editor which didn’t have any problem with either setting. I just gave it another try since the latest version was released and thought the issue was fixed until I opened the project from work with sublime’s default settings.

0 Likes

#17

Are these some insights on how big the ST core is? :smiley:

1 Like

#18

What would happen if I set "index_files": false, Does it just have issues on the sidebar or would other issues occur?

Also tested the index_workers at work again and it seems to make sublime a lot smoother combined with my usual "folder_exclude_patterns" setting:
[".svn", ".git", ".hg", "CVS", "node_modules", "bower_components", "coverage", "docs", "tmp", "temp", "log", "logs", "build", "builds", "dist", "resources", "...SOME_OPTIONALS_I_TOGGLE_BETWEEN_PROJECTS" ]

0 Likes

#19

Goto Definition and ctrl+shift+r (goto symbol in project) will not work without indexing. Otherwise, no issues.

Note that you can have folder-specific exclude patterns in projects, see http://docs.sublimetext.info/en/latest/file_management/file_management.html#the-sublime-project-format.

0 Likes

#20

Do I set these values in user settings file?
“index_files”: false,
“index_workers”: 1

I just downloaded 3114 build and with these values set Sublime Text 3 is still unusable when I have a build running which uses all my cores and 100% CPU. Sublime Text 2 that I have runs the same whether I have a build running or not.

0 Likes