Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

High CPU usage issue #50

Open
alexbet opened this issue May 2, 2018 · 9 comments
Open

High CPU usage issue #50

alexbet opened this issue May 2, 2018 · 9 comments

Comments

@alexbet
Copy link

alexbet commented May 2, 2018

Actual Behavior

Many times CPU goes to 100% when saving an SCSS file for some reason and locks SublimeText for 5-10 seconds. At the time that his happens, I can see that a process called "plugin_host" which is a Sublime process use up 100% of the CPU. If I disable the Javascript Enhancements plugin, everything is normal. Very weird because the SCSS file has nothing to do with Javascript.

Sublime Text console logs

PARSING SAVED VIEW
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 389, in run_callback
expr()
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 488, in
run_callback('on_modified', callback, lambda: callback.on_modified(v))
File "/Users/AlexBet/Library/Application Support/Sublime Text 3/Packages/SublimeCodeIntel/SublimeCodeIntel.py", line 1439, in on_modified
sublime_scope = getSublimeScope(view)
File "/Users/AlexBet/Library/Application Support/Sublime Text 3/Packages/SublimeCodeIntel/SublimeCodeIntel.py", line 394, in getSublimeScope
return view.scope_name(pos)
File "/Applications/Sublime Text.app/Contents/MacOS/sublime.py", line 873, in scope_name
return sublime_api.view_scope_name(self.view_id, pt)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 4: invalid start byte
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 389, in run_callback
expr()
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 488, in
run_callback('on_modified', callback, lambda: callback.on_modified(v))
File "/Users/AlexBet/Library/Application Support/Sublime Text 3/Packages/SublimeCodeIntel/SublimeCodeIntel.py", line 1439, in on_modified
sublime_scope = getSublimeScope(view)
File "/Users/AlexBet/Library/Application Support/Sublime Text 3/Packages/SublimeCodeIntel/SublimeCodeIntel.py", line 394, in getSublimeScope
return view.scope_name(pos)
File "/Applications/Sublime Text.app/Contents/MacOS/sublime.py", line 873, in scope_name
return sublime_api.view_scope_name(self.view_id, pt)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 4: invalid start byteeventual errors -->

Specifications

  • Sublime Text 3 build: 3143
  • OS: Mac OS 10.13.4
  • JavaScript Enhancements version: 0.16.13
@alexbet alexbet changed the title CPU issue High CPU usage issue May 2, 2018
@pichillilorenzo
Copy link
Owner

I can't get this scenario! On my Mac I don't have this problem.
Do you have some other plugins for scss files?

@alexbet
Copy link
Author

alexbet commented May 4, 2018

The only ones I use are these:
https://packagecontrol.io/packages/Sass
https://packagecontrol.io/browse/authors/Kenneth%20Skovhus

Just FYI, this doesn't happen all the time, but sometimes only, but I can't predict when it will happen. It may also be helpful to know that my files are on a mounted network drive. It is weird that this doesn't happen on Javascript files or any other files. I am really confused why your plugin will have anything to do with SCSS files.

I love your plugin! I just hope I can somehow solve this so I can use it.

@pichillilorenzo
Copy link
Owner

Ok ok.. This is weird because I don't consider scss files on my plugin, so it has no sense to happen. I will try to check about it! Thanks

@alexbet
Copy link
Author

alexbet commented May 4, 2018

Could it be some conflict with the the SCSS plugin?

@pichillilorenzo
Copy link
Owner

I don't know but it could be

@trongthanh
Copy link

I can reproduce this with normal CSS files.

Here's my related console error logs:

PARSING SAVED VIEW
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 462, in run_callback
    expr()
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 569, in <lambda>
    run_callback('on_modified', callback, lambda: callback.on_modified(v))
  File "/Users/thanh/Library/Application Support/Sublime Text 3/Packages/JavaScript Enhancements/src/listeners/completion.py", line 333, in on_modified
    if scope.endswith(" punctuation.dollar.js") or view.substr(view.word(sel.begin()-1)) == " $" or view.substr(view.word(sel.begin()-1)) == "\n$":
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime.py", line 845, in substr
    return sublime_api.view_cached_substr(self.view_id, x.a, x.b)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
Traceback (most recent call last):
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 462, in run_callback
    expr()
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 569, in <lambda>
    run_callback('on_modified', callback, lambda: callback.on_modified(v))
  File "/Users/thanh/Library/Application Support/Sublime Text 3/Packages/JavaScript Enhancements/src/listeners/completion.py", line 333, in on_modified
    if scope.endswith(" punctuation.dollar.js") or view.substr(view.word(sel.begin()-1)) == " $" or view.substr(view.word(sel.begin()-1)) == "\n$":
  File "/Applications/Sublime Text.app/Contents/MacOS/sublime.py", line 845, in substr
    return sublime_api.view_cached_substr(self.view_id, x.a, x.b)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

@pichillilorenzo
Copy link
Owner

@trongthanh I think that this is a bug of a function of Sublime Text API: view.substr().
In case, can you post here or send me the css file that causes that?
@alexbet also you, can you post here or send me the scss file that causes that??
Thanks!

@alexbet
Copy link
Author

alexbet commented May 18, 2018

Hey @pichillilorenzo , here is a file that does this. However, basically any SCSS file does it.

main.scss.zip

@alexbet
Copy link
Author

alexbet commented Feb 26, 2019

@pichillilorenzo, any news on this? I still can't use your plugin because of this and I really want to use it. Is there any way that you can disable scanning of Scss and Sass files?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants