Sublime Forum

ST4 slow after upgrade from ST3

#1

Hi Sublime Community,

I have bought ST3 a couple of weeks ago over PHPStorm for the speed. I was using it on a Dell XPS 13 i7-8550U 16MB RAM Intel Graphics on Linux Mint 20.1 and everything was lightening fast and perfect.

But today I installed the latest stable build, upgrading it to Build 4107, and with all the same settings and packages and with the same theme it started reindexing my relatively small Laravel project again and again very slowly. Also loading and viewing each file took several seconds.

I have tried to purge and reinstall the same build with and without the same packages, but it’s still the same. I have turned off indexing, but loading and showing a file whilst switching between different syntax highlights still takes several seconds with and without syntax highlighting packages installed, showing a loading bar each time. I have downloaded the older version (ST3) and that works fine.

Any ideas? Thanks.

0 Likes

ST4 issues I found, but have no time to write proper bug reports (yet)
#2

Are you using a plugin for PHP files ?
You can try running ST in safe mode (it disable all plugins: https://www.sublimetext.com/docs/safe_mode.html) to check if the issue comes from a plugin or from ST directly

0 Likes

#3

I am using the following plugins.

A File Icon
DotENV
Laravel Blade Highlighter
Material Theme
Package Control
Syntax Highlighting for Sass
Vue Syntax Highlight

The safe mode is handy, better than deleting the data directory, but unfortunately it makes no difference. The repeated indexing is still very slow (a few minutes) and each time I view one kind of file the syntax highlighting loads for a few seconds before ST shows the content.

0 Likes

#4

The first time you open a PHP file after each start up will take a noticeable time. But after that, it should be instant.

0 Likes

#5

Ok, but ST3 didn’t seem to need extra time for PHP highlighting. And do you know why this is the case just for PHP files?

And is that related to the repeated slow indexing as well? I have tried to exlude the node modules folder from the indexing with the setting for “binary_file_patterns” but that made no difference.

0 Likes

#6

I don’t actually know. But both PHP and JS (embedded in PHP) grows their complexity due to new syntax grammars as of ST 4.

0 Likes

#7

Something strange seems to go on with PHP which seems to be caued by something beyond “grown complexity”. Spent some time investigating but haven’t found a route to the root cause yet.

0 Likes

#8

The reindexing should happen once after an update of ST and after it is trigerred only by change on file. Are you using file on a network or something ? You can check the indexing status in the help menu or type sublime.log_indexing(True) to get some info about what is going on

0 Likes

#9

The project is not on a network. A full reindexing happens on every restart of ST4 and takes about 5 minutes. A partial reindexing on change of file happens very quickly, once the full reindexing is complete. Here is the output of my indexing log.

index “” collated in 0.00s from 0 files
index “” is using 0 bytes for 0 symbols across 0 locations
indexing [job 1]: spawning 2 workers to process 4096 / 24346 files
indexing [job 1]: indexed 4096 files
indexing [job 1]: spawning 2 workers to process 4096 / 20250 files
indexing [job 1]: indexed 3552 files
indexing [job 1]: spawning 2 workers to process 4096 / 16698 files
indexing [job 1]: indexed 3589 files
indexing [job 1]: spawning 2 workers to process 4096 / 13109 files
indexing [job 1]: indexed 1626 files
indexing [job 1]: spawning 2 workers to process 4096 / 11483 files
indexing [job 1]: indexed 2583 files
indexing [job 1]: spawning 2 workers to process 4096 / 8900 files
indexing [job 1]: indexed 651 files
indexing [job 1]: spawning 2 workers to process 4096 / 8249 files
indexing [job 1]: indexed 1893 files
indexing [job 1]: spawning 2 workers to process 4096 / 6356 files
indexing [job 1]: indexed 3107 files
indexing [job 1]: spawning 2 workers to process 3249 / 3249 files
indexing [job 1]: indexed 3249 files
index “myproject” collated in 0.58s from 24346 files
index “myproject” is using 9604160 bytes for 89602 symbols across 1000983 locations
indexing [job 2]: spawning 1 workers to process 2 / 2 files
indexing [job 2]: indexed 2 files
index “myproject” collated in 0.59s from 24346 files
index “myproject” is using 9604176 bytes for 89602 symbols across 1000983 locations

0 Likes

#10

I opened a project using safe mode and it still takes some seconds (1 or 2) to open a 2.5 KB php file.

In ST3, I can open way bigger files in milliseconds.

The reason I prefer Sublime Text over any other text editor is its speed… I hope this is fixed soon.

0 Likes

#11

As said above, the first time to open a PHP file, ST has to load the PHP syntax cache so it takes time. If you open a second PHP file, it should be instant.

0 Likes

#12

I understand that. But that didn’t happen on ST3. So, there should be a way to avoid it in ST4 too.

2 Likes

#13

Hi,
I noticed this too, especially with PHP files. ST3 opened files faster than ST4. I must say I am on a 2014 MacBook Pro, maybe you cannot notice the loading time on newer machines.

1 Like

#14

Further investigation is required, but I’ve made a preliminary issue here: https://github.com/sublimehq/Packages/issues/2829

0 Likes

#15

This issue is fixed in ST 4109, as stated in the Github issue.

0 Likes