Sublime Forum

How to determine if Sublime is slow vs plugins?

#1

Recently, I’ve had to open some very large (10,000+ lines of code). How can I determine if Sublime itself is being slow, or if one of my plugins is the culprit? I’m hoping there is some hidden solution similar to Chrome’s “Task manager”.

I was able to open the same file in Visual Studio Code and it handled it with ease, which disappointed me more than a little.

Is there a way to figure it out without painstakingly disabling all plugins and turning them back on one by one? Is it possible to start Sublime Text in “safe mode” with no external plugins running?

Thanks!

1 Like

Does the setting detect_slow_plugins still exists?
#2

Maybe you could try Tools → Developer → Profile Plugin.

2 Likes

#3

You can select Tools > Developer > Profile Plugins to get a profile report showing how much time plugins are taking to respond to events.

There is no “safe mode”, but you can simulate it by adding all of your user installed plugins to the ignored_packages setting in your user preferences. If you only (or even mostly only) have packages installed via Package Control, you can use Preferences > Package Settings > Package Control > Settings - User to open the Package Control settings file and copy the contents of installed_packages to disable them all.

Additionally if you’re using Windows you can test with the portable version; that version ignores the settings in your user profile, which is a fast way to get at “baseline” reading.

1 Like

#4

Are you using a built-in syntax, or have you installed a custom syntax for the language you are using?

Generally for built-in syntaxes, Sublime Text can easily handle files with hundreds of thousands of lines. For instance, on my 2013 MacBook, Sublime Text can load and highlight the 200k C file for SQLite 3 in about 1 second.

Things can get a little laggy if lines are tens of thousands of characters long, especially if also using multiple cursors.

Third-party packages can slow things down if they are written inefficiently. This does tend to happen with really large files since many users won’t ever be working with such large files, and thus won’t notice the performance issues they have introduced.

The Profile Plugins command mentioned by @math2001 and @OdatNurd can be helpful here.

You can also go back to a stock install by:

  1. Closing Sublime Text
  2. Moving your data folder (http://www.sublimetext.com/docs/3/revert.html)
  3. Starting Sublime Text

Once done, close Sublime Text and restore your data folder.

1 Like

#5

Thanks for all of the tips. Using Profile Plugins, I was able to find that my Git Conflict Resolver plugin had very poor timings, and Default.symbol was pretty slow as well. I removed the plugin, and added more folders to ignore to my settings, respectively.

After that, it became obvious that Bracket Highlighter was my next problem because several months ago, I had set it to search beyond the default threshold for brackets.

ST3 is working much better now! :grin:

2 Likes

#6

I do have a custom syntax, JavaScriptNext - ES6 Syntax, which was in use. I didn’t notice much of a difference, if any, after disabling that particular thing (though this was after fixing the other causes of lag).

There is still some lag with the auto-complete pop-up in that large file, but I’m not sure what I would do to fix that. It’s noticeable but not unreasonable.

1 Like

#7

In my case turning off Windows Defender Real Time scan did the trick.

1 Like

#8

To quickly find slow times you can use this in the find box using regexp.

0\.0[1-9]

This will find anything greater than 0.01s.

Bracket Highlighter
File History
TabsExtra
ScopeHunter
HexViewer

Where my culprets it seems in my case.

0 Likes