Sublime Forum

Mitigating the 3176 crash / cpu overload

#21

Did you install a third-party package for syntax highlighting, or did one of them update? The indexer uses the syntax definitions to locate function and class definitions, so if one of your primary languages had the syntax update to something with an inefficient regex, that could certainly affect indexing performance.

Is the project primarily JavaScript or TypeScript? What third-party packages do you have installed for JS/TypeScript?

0 Likes

#22

The projects that are causing woes are JS projects (no TS).

I donā€™t think Iā€™m using a custom syntax highlight for JSā€¦ I do have others installed but Iā€™ve never used them, and when I open JS files myself they open in JavaScript:

Would the indexer use these ones as well? Should I disable / kill them somehow?

I also banned *.md files (and *.todo since theā€™re similar) since I saw another thread complaining about those taking forever as well (and I do use Markdown Enhanced).

Now Iā€™m restarting sublime it maybe doesnā€™t do this anymore? Itā€™s hard to tell, the index maybe just thinks itā€™s up to date.

One thing Iā€™ve noticed that is really weird, is that I have a folder attached to one of the problematic projects called _meta, which just contains a collection of notes and things like that. The Indexer gives me this:

index "_meta..." collated in 0.04s from 1236 files
index "_meta..." is using 4273664 bytes for 10306 symbols across 68538 locations

The entirety of this directory ls this (core filenames anonymised but with their original extensions):

$ ll -a ../_meta/
total 352
drwxr-xr-x  20 scdf  staff    640 28 Jan 16:05 .
drwxr-xr-x  56 scdf  staff   1792 28 Jan 14:16 ..
-rw-r--r--@  1 scdf  staff   6148 20 Jul  2017 .DS_Store
-rw-r--r--@  1 scdf  staff    742 23 Dec 16:35 a text file
-rw-r--r--@  1 scdf  staff   1097 24 Jan 12:09 aaa.md
-rw-r--r--@  1 scdf  staff   6978 25 Sep 05:13 bbb.md
-rw-r--r--@  1 scdf  staff  11476 29 Jan 09:08 ccc.md
-rw-r--r--@  1 scdf  staff   4910  4 Oct 21:55 ddd.md
-rw-r--r--@  1 scdf  staff    871 23 Dec 16:35 a text file
-rw-r--r--@  1 scdf  staff   2490  1 Feb 13:58 eee.md
-rw-r--r--@  1 scdf  staff   6095  5 Feb 19:49 eee.todo
-rw-r--r--@  1 scdf  staff   4626 25 Sep 05:13 fff.md
-rw-r--r--@  1 scdf  staff   4571 29 Sep  2017 ggg.todo
-rw-r--r--@  1 scdf  staff    633 22 Feb  2018 hhh.todo
-rw-r--r--   1 scdf  staff  51919  5 Feb 21:07 iii.todo
-rw-r--r--@  1 scdf  staff  20754 29 Jan 13:45 jjj.todo
-rw-r--r--@  1 scdf  staff    303  7 Sep  2017 one singular js file.js
-rw-r--r--@  1 scdf  staff   3056  1 Feb 13:58 kkk.todo
-rw-r--r--   1 scdf  staff   5456  1 Feb 13:58 lll.todo
-rw-r--r--@  1 scdf  staff   1325  8 Nov 15:21 mmm.todo
$ cat ../_meta/* | wc -l
    1760

Itā€™s unclear to me, especially after Iā€™ve banned markdown and todoā€™s from indexing, what itā€™s doing exactly. Here is my exclude:

	"index_exclude_patterns":
	[
		"*.log",
		"*.class",
		"node_modules",
		"*.md",
		"*.todo"
	],
0 Likes

#23

(I worked out how to nuke the cache and I re-ran it, same weird _meta indexing issue where it takes forever to index nothing)

0 Likes

#24

OK I understand the _meta index thing: _meta... means _meta + the other directories. So itā€™s not actually whatā€™s in that dir, itā€™s whatā€™s in that dir and the other folders I have in that project.

0 Likes

#25

OK so Iā€™m pretty convinced this is actually Rust (Iā€™ve had rust projects open most of this time).

For me, on the latest dev build, every time I make a tiny change the indexer goes nuts again and spends ages re-indexing. I only have one file, main.rs, and itā€™s 20 lines long.

Iā€™ve ignored and excluded the target directory in my project file:

{
	"folders":
	[
		{
			"folder_exclude_patterns":
			[
				"target"
			],
			"index_exclude_patterns":
			[
				"**/target/**"
			],
			"path": "."
		}
	]
}

I was using Rust Enhanced, but Iā€™ve disabled this to see if that helps, but no luck, the default rust syntax seems just as bad.

0 Likes

#26

Reverting to the current non-dev build has fixed this for me (I think, itā€™s only been a day).

@wbond, has there been any indexing changes between the current main build and dev?

0 Likes