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 when this plugin is enabled #144

Closed
xhpohanka opened this issue May 18, 2020 · 13 comments
Closed

High CPU usage when this plugin is enabled #144

xhpohanka opened this issue May 18, 2020 · 13 comments

Comments

@xhpohanka
Copy link

I see a high CPU usage (around 15-20%) with TrailingSpaces enabled, even when sublime is on background. My operating system is Arch Linux, sublime-text-dev package...

@rchl
Copy link
Member

rchl commented May 18, 2020

What kind of CPU do you have?
Does the problem persist after ST restart?
Does it happen right away after restart or after using ST for some time?

@xhpohanka
Copy link
Author

What kind of CPU do you have?

Intel(R) Core(TM) i7-8565U CPU

Does the problem persist after ST restart?

Yes

Does it happen right away after restart or after using ST for some time?

On my setup it is perfectly reproducible, the CPU is stressed whole time since starting ST. It goes back to normal when I add TrailingSpaces into ignored packages...

@rchl
Copy link
Member

rchl commented May 18, 2020

There is a update_interval setting (by default set to 250ms) that you can try changing to something much higher just to confirm that it's that causing the issue.

@xhpohanka
Copy link
Author

It really seems that it is related. When setting update_interval to 25000 I have a 20% peak on CPU usage each 25 seconds :)

@rchl
Copy link
Member

rchl commented May 18, 2020

  • Does it reproduce on any file being focused? Even something extreme like a view with one word?
  • Have you customized any TrailingSpaces settings? Can you post them if so?

I can see something like this with TS enabled:
Screenshot 2020-05-18 at 23 16 11

So CPU usage jumps up and then slowly gets lower until it jumps up again. And that's over many seconds, with a default 250ms interval. It seems weird to me.

@xhpohanka
Copy link
Author

xhpohanka commented May 19, 2020

I see similar behavior as you - CPU usage peaks and then it is slowly decreasing, then peaks again.
When there is no file opened CPU is low as well as with file with no syntax enabled.

TrailingSpaces settings is blank. I also tried to find if there is any interaction with other packages but it does not seem so.

@rchl
Copy link
Member

rchl commented May 19, 2020

FYI: Created ST issue for it sublimehq/sublime_text#3353

@nho-sh
Copy link

nho-sh commented Jun 13, 2020

I was also experiencing a continuous high CPU load in ST3. After trying a lot of things, I finally narrowed it down to this plugin. Setting a high update_interval (10s) seems to work, thanks

@rchl
Copy link
Member

rchl commented Jul 13, 2020

This is fixed in the latest dev builds of ST4 (see sublimehq/sublime_text#3353) so I'm closing this issue also.

Unfortunately, it's not likely that ST3 will receive the same fix.

@rchl rchl closed this as completed Jul 13, 2020
@garymoon
Copy link

Just to be sure I understand, there's a bug in ST causing this, it's been fixed in the latest dev release, but the same fix won't be applied to the current stable release, and now the bug is closed?

@rchl
Copy link
Member

rchl commented Aug 23, 2020

Yes. The solution for ST3 users is to increase the update_interval value to minimize the issue.

@garymoon
Copy link

I guess I have to appreciate the honesty? 🤷‍♂️ Thanks @rchl.

@dcanuhe
Copy link

dcanuhe commented Nov 14, 2020

@garymoon: reverting to e24719053fe6960a327591d2c48ccbd49684500d fixed this issue for me. It's not ideal, but it works.

@rchl rchl mentioned this issue Dec 3, 2020
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

5 participants