saem / vscode-nim

Other
180 stars 23 forks source link

Run nimsuggest with low priority #121

Open arnetheduck opened 1 year ago

arnetheduck commented 1 year ago

nimsuggest and friends are low-priority helpers - as such, it would be preferable to run them with lower scheduling priority so that it doesn't hog valuable CPU when compiling.

saem commented 1 year ago

Hmm, I'd say potentially prioritize nimsuggest more aggressively or keep it the same. Then if a build or other action is initiated, ease off in sending requests to nimsuggest so it calms down naturally based on how the user is acting.

arnetheduck commented 1 year ago

nimsuggest keeps analyzing code even if you're doing other stuff that's more important (such as typing or building) - neither of these are things that you want slowed down (ie stuttering typing just because nimsuggest slowly is crawling through hundreds of modules is poor UX and slowing down builds is counterproductive since the build is more accurate and important generally than suggest) - you generally cannot detect if the computer is being used for something else, ie "build" might be launched from command-line outside of vscode - the OS can however, and act on it via prios.

root-11 commented 10 months ago

I can confirm that nimsuggest.exe is consuming 100% on a core on windows despite that I'm just reading the code - e.g. no edits.