Лагает sublime text 3
Я использую Sublime Text 3 для веб-разработки. Время от времени он запускает процесс PHP с загрузкой процессора на 100%. Мой Mac начинает тормозить, а фанаты громко.
Как я могу выяснить, почему это происходит? Я думаю, что это один из плагинов, которые я использую: SublimeLinter-php или же SublimeLinter-phpcs , но я не уверен.
Есть ли способ проверить это, кроме отключения плагинов и ожидания, если это произойдет? Это было бы хлопотно, потому что иногда это происходит через несколько часов, а развитие без них мне неприятно. Вы испытывали подобное поведение с Sublime Text 3?
1 Answer 1
I eventually found the cause of / solution to my problem and am going to answer my own question in case somebody else might have the same problem:
My .bash_profile file contained the following snippet of code which seemed to have been added by the Anaconda installer at some point:
It seems that this code was being executed every time I started my terminal and causing a waiting time of around 5-12 seconds which was quite annoying. I tried removing it and now my terminal would boot immediately. Also, Sublime now executed much faster after this change (the speed you would normally expect).
It seems that sublime boots an instance of the terminal within the editor, while atom (which was not affected by the anaconda code in .bash_profile causing the slow down) seems to be doing something different.
I was now facing the issue though that I couldnt call conda in the terminal. I was able to fix this by adding the line:
When edit big js file (1.6mb) , sublime text 3 become very slow.
finscn commented May 7, 2019
jfcherng commented Mar 28, 2020
jfcherng commented Feb 26, 2020 •
do a plugin profiling anyway. if you didn't revert ST to its clean state, re-installation basically does nothing.
gibbopotam commented Feb 26, 2020
The same, very slow for large JS files. Syntax - JavaScript, no lag with Plain Text or with un unsaved buffer. In particular, problems when scrolling @finscn file above. I actually noticed that on my smaller .js file, only about 470kB. MacOS Mojave 10.14.6, Sublime Text Build 3211. It didn't take place on High Sierra (updated to Mojave only recently).
Steps to reproduce
- open the big js file . I use pixi.js (without minimize , it's 1.6MB)
- edit it
FichteFoll commented Apr 16, 2020
Closing as timeout.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
MauroSequenzia commented Apr 7, 2020
thank you friend, it is not needed any more
Другие решения
Я обнаружил, что Sublime Text 3 на Yosemite (Macbook Air 2014) начал отставать, глядя на Activity Monitor Sublime на 150% CPU. После нахождения этой темы, которую мы сейчас читаем, о том, что плагин для SublimeLinter стал источником некоторых проблем, я отключил SublimeLinter-jshint, и Sublime немедленно отбросил. К сожалению, потому что это отличный инструмент для Sublime.
Теперь он отключен от 2% до 10% после отключения jsHint.
PhpConnector дает мне также высокую загрузку процессора. Я удалил его и все пришло в норму. Итак, в моем случае и PhpConnector, и SublimeLinter-phpcs провоцируют высокую загрузку процессора.
У меня тоже была эта проблема с проектами web / nodejs.
Вместо того, чтобы полностью отключить индексирование, я просто проигнорировал мою папку node_modules, которая содержит зависимости узлов.
Если вы работаете с php, вы можете игнорировать некоторые папки, например, vendor.
В ваших настройках добавьте следующую строку:
У меня такая же проблема с установленным SublimeLinter-phpcs. Я могу убедиться, что phpcs является причиной проблемы. Это не сам плагин SublimeLinter, а процесс PHP_CodeSniffer, который зависает и вызывает 100% загрузку ЦП.
Единственное решение на данный момент, пока PHP_CodeSniffer не исправит ошибку, это удалить плагин SublimeLinter-phpcs.
I've been using Sublime Text 3 for some time now, and over the past few weeks I've run into an issue where Sublime will spawn numerous processes, eating up 100% of my CPU.
Below is the output of wmic process where "name='sublime_text.exe'"
When I open Sublimes console, I see the following lines
I've since removed the entire /D/dev/project/ext folder from the index, and then I removed it from the project entirey, but that didn't seem to help.
Has anyone seen this before? I'd really rather not do a full re-install of Sublime.
Just for sake of it, have you tried to delete the entire Sublime Text index database? It's the "Index" directory located in Sublime's data folder (do not forget to close every instances of the editor and ensure its processes are not running anymore).
I did try that, but it didn't work. I was able to figure it out though, I'm writing up the answer now. Thanks for your help
Environment
- Build: Dev 3208
- Operating system and version: macOS 10.14
The text was updated successfully, but these errors were encountered:
Actual behavior
FichteFoll commented Mar 10, 2020
@finscn can you reproduce this issue from your initial report with a reverted profile?
MauroSequenzia commented Mar 6, 2020
resolved uninstalling typescript plugin
thnks Jack
titoBouzout commented May 7, 2019
Did you try by disabling all the packages, also which syntax highlighting are you using?
I dont see a noticeable lag, but is also not as smooth.
Expected behavior
as fast as previous version of sublime text 3
Решение
Попробуйте добавить "index_files": false в соответствии с вашими предпочтениями пользователя ( Preferences > Settings - User ) и посмотрим, поможет ли это.
jfcherng commented Feb 26, 2020 •
Do you guys have the TypeScript package installed? It was the culprit for me.
Or you guys just do a plugin profiling by yourself to find possible culprit(s).
Tools -> Developer. -> Profile Plugins.
4 Answers 4
You can try this:
shift + super + p :
It may be the case that you have opened a project which contains 3rd party libraries.
In my particular case I have this kind of problem if I do not exclude from Project Index node_modules directory of some bigger node.js application.
Sublime Text tries to refresh index files on each run.
Add exclude pattern in your Project:
I have had this question come up several times so I'd like to give a more complete answer.
The processes you see are the indexing workers which are parsing all of the files included in the side bar of your project(s) (yes, every single file) and building an index for Goto Anything. See Sublime Text 3 File Indexing.
This can be completely disabled by adding "index_files": false, to your Preferences.sublime-settings ( Prefereces > Settings ). To disable this system-wide, you add it to your Default settings file, or you can add it to your User setting file. Either will work.
However, if you would rather not disable indexing entirely, you can simply modify the scope of the files that are excluded from indexing:
(this is a good starting list, but feel free to edit to better fit your needs)
Additionally, you might also want to expand what is considered a "binary" file (binaries are also excluded from indexing):
I have seen people suggest adding folders to the folder_exclude_patterns array, but that is the list of folders to hide from display in the side bar. While folders not displayed in the side bar will not be indexed, there might be files or folders that you do want displayed but don't want indexed; in such cases index_exclude_patterns should be used.
Indexing exclusions can also be defined per project in the *.sublime-project file:
It is also worth noting that you can limit the number of indexing worker processes with "index_workers": 1, where 1 is the number of worker processes. By default that number is 0 which instructs Sublime to guess and the optimal number of workers based on the number of CPU cores available.
My Sublime Text editor is running very slow, which is causing some problems when working on tasks that involve a lot of iteration.
When I run the following line in the editor:
I am very surprised that Sublime needs 7.3 seconds to run the code. When running the same script in Atom it takes me 0.083 seconds.
This my code I have entered in my Settings. I don't think there is any connection, but I am including it just for completeness and should I maybe be overlooking something
What might be causing this slow-down and how could I speed this up?
Sublime shells out to the external python command to run your code and times how long it takes the command to run. As such, a long execution time isn't necessarily related to Sublime per se unless things like typing appearing also seem to take an extreme amount of time. That said, your question includes the output twice; did you mean to include something different the second time?
@OdatNurd Thanks for your reply. So youre saying that it should be taking approximately as long as if I'd be running it with 'python3 myapp.py' in the terminal? Also, thanks for your attentiveness. I replaced the second chunk of code by the originally intended snippet
More or less, yes; behind the scenes Sublime is using the Python subprocess.Popen() call to run the program and capture the output, so there may be a bit of time spent by the OS in starting a new process, but otherwise everything happens outside of Sublime. Possibly the process takes less time to run and finish than it takes Sublime to notice that it's completed, but you'd notice it already being finished and not telling you the time in that case.
gibbopotam commented Feb 26, 2020 •
I just reinstalled Sublime Text, the problems persist. As a workaround, with Plain Text being too dull, I use Syntax -> C. Some other syntaxes do also lag for me. @jfcherng: I didn't install TypeScript package, but installed Dart package some time ago and still see it active.
gibbopotam commented Feb 26, 2020 •
@jfcherng Thanks, it worked! Uninstalling Dart plugin didn't help, but I then uninstalled TypeScript plugin (probably existed by default for I didn't install it), and now I use Syntax -> JavaScript and it's fast. Thanks again.
Steps to reproduce
- Create a Sublime Text Vanilla Install
- Install Package Control
- Install the packages BracketHighlighter and A File Icon
- Restart Sublime Text
- Set the setting "enable_hexadecimal_encoding": false, on User/Preferences.sublime-settings
- Dowload the binary file: sublime-text-3.zip (60MB)
- Open with Sublime Text, the binary file sublime-text-3.zip (60MB)
- Select the word sublime and press Ctrl+F
- Now, each second, press the key F3
- While you are doing that, you will see the sublime_text and plugin_host RAM usage keep dangling between 150MB up to 600MB for a 60MB file.
On Linux plugin_host crashes
This recording is showing these steps on Linux (Pressing F3). Most of the time, Sublime Text interface is hanged up and very slow responsive, while plugin_host and sublime_text keep their memory size increasing and decreasing, until plugin_host crashes after about 100 seconds playing with it:
This is the crash report produced by the apport program:
- After I increased the virtual machine RAM memory to 2GB, plugin_host still crashing, but now it takes longer, after it reaching 1GB of RAM usage. At this moment, all the virtual machine RAM memory was already used. Then, it probably crashed because if tried to allocate more memory, but the system did not have any more RAM left as plugin_host was using 1GB and sublime_text was using 1GB too.
- Then, I think the only fix here would be for plugin_host and sublime_text to not crash if it tries to allocate more memory but the system denies it.
On Windows plugin_host works fine
On the beginning (Pressing F3), plugin_host.exe and sublime_text.exe memory usage was dangling and hanging a little just like on Linux, but soon they stabilized, the interface lagging stopped and the use of Sublime Text become steady (i.e., responsive), differently from Linux, where the RAM usage kept dangling and lagging for ever, until plugin_host crashes 100 seconds later:
Disabling both Packages BracketHighlighter and A File Icon fixes the reported Linux lagging and crash issue of opening a big file and using the search button (Pressing F3).
Читайте также: