Sublime Forum

Just updated to 3.2.2 (BUILD 3211) - CPU usage issue

#1

Just updated to the latest version and Sublime started overloading the CPU of my Mac Book Pro 13". Any idea what is going on?

0 Likes

#2

The syntax definitions that Sublime uses to syntax highlight code when you edit it are also used to generate an index of symbols for things like Goto Symbol and Goto Definition. When you upgrade Sublime, it generally has newer syntax definitions so as a result the first time you work with your code after the upgrade Sublime has to re-index your code to get things in line with the syntax. Once the code is indexed, the CPU load should go away as Sublime will only re-index files as they change instead of everything all at once.

Indexing is generally pretty quick but if you have a lot of files in your project (examples include web projects, particularly those where node_modules is not excluded from the index) or a lot of big files, it can take a while to index things.

You can tell if this is happening to you by using Help > Indexing status to track what the indexer is doing. In cases where this is the problem, you can use the index_workers and index_exclude_patterns settings to control the indexing (or index_files to turn it off completely if you would rather, though that removes a lot of functionality).

In particular the default setting for index_workers tries to guess how many threads it should use for indexing, which may be too high. In such a case manually constraining the number can reduce the CPU load (at the expense of the indexing taking a longer time).

1 Like