harper icon indicating copy to clipboard operation
harper copied to clipboard

harper-ls --stdio using too many threads

Open acampove opened this issue 2 years ago • 9 comments

Hi,

I just downloaded this with Mason and I am using it with neovim. I suddenly found out that I cannot spawn threads and when I check with htop I see that harper-ls is using about 150 theads:

image

Why is this happening? How can I configure this tool to use only one thread?

Cheers.

acampove avatar Oct 03 '24 01:10 acampove

This should be configured by tokio to be the number of cores on your machine, how many do you have?

grantlemons avatar Oct 03 '24 18:10 grantlemons

This should be configured by tokio to be the number of cores on your machine, how many do you have?

I probably have around 128 cores. Do you know how to configure this using? I definitely do not think the program should be allowed to use all the cores. It should be limited to 2, at most 3. I am seeing the same problem with pyright, BTW.

acampove avatar Oct 04 '24 00:10 acampove

Ah. This should be a simple fix. We'll set harper-ls to cap out at 4 threads. That should be more than enough.

elijah-potter avatar Oct 04 '24 15:10 elijah-potter

@grantlemons drafted a fix and it has been merged. I'm going to spend some time with Harper this afternoon to make sure everything checks out before creating a release. At that point, you can confirm that the problem is fixed.

elijah-potter avatar Oct 04 '24 21:10 elijah-potter

@grantlemons Thanks, could you please make another tag, 0.12.0? I am using Mason and this seems to download the latest tag.

acampove avatar Oct 05 '24 00:10 acampove

Sorry it took so long to get back to you on this. The Mason maintainer is extremely unresponsive when it comes to PRs. You should be able to get a new version now. Would you mind confirming whether your issue has been fixed?

elijah-potter avatar Jan 03 '25 20:01 elijah-potter

I'm assuming we're good here. Thanks for letting us know about the problem!

elijah-potter avatar Feb 27 '25 16:02 elijah-potter

Hi @elijah-potter thanks. I am having other issues with neovim, this time memory issues, but I think I haven't really seen any problem with this plugin lately, so I assume the update fixed the issue.

acampove avatar Feb 28 '25 06:02 acampove

I'm sorry about the other issues, but I'm glad Harper's working. Thanks again!

elijah-potter avatar Feb 28 '25 21:02 elijah-potter