Sticky plaster approach to temporary workaround high CPU usage (MacOS) #568
universemaster
started this conversation in
General
Replies: 2 comments
-
This approach now works on my Mac with
I don't think this is the best long-term solution, but I'll use it like this until there is a better solution. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This approach does indeed limit the cpu usage, but since it's common for 5-6 instances of vale to be running at the same time, even setting to 25% for each instance still results in the noisy fan running. It's worth noting that this probably isn't just a problem of noise, I very much suspect that it runs laptop batteries down fast too. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been experimenting with a temporary sticky plaster approach for high CPU use of vale, see #567 and errata-ai/vale-vscode#113
It seems work has begun on sending just the context rather than the full file (in vscode) to vale, which definitely is the best approach to try first.
However, I had already got some way into looking at how to restrict CPU usage on macos in general, and thought I'd share my progress in this discussion.
Install cpulimit:
Create a script called
call-vale-with-reduced-cpu.zsh
with use of positional parameters, which need escaping in the quoted sh argument:Note the
-l 50
which limits to cpu to 50%.Make the script executable
Then, I can see that I get expected json output in the terminal and cpu is restricted to 50% when I run:
But, here's my current blocker: When I set the following in vscode settings:
Then, I get
SyntaxError: Unexpected token P in JSON at position 7893
in vscode's Vale Output panel, for any file I open (actually I'm no sure vale is even running). Always the same position. I don't know how to debug this or see the exact json that vscode is trying to import (or export?)I suspect I need to tweak
call-vale-with-reduced-cpu.zsh
slightly, but cannot work out how?If it's quick - I'd love to know how to get this approach working (although granted, I think this is a sticky plaster temporary approach, not a "proper fix). However, I don't suggest much time is devoted to this approach: this will only be needed if the other fixes cannot lower the usual CPU usage.
Beta Was this translation helpful? Give feedback.
All reactions