arduino / arduino-language-server

An Arduino Language Server based on Clangd to Arduino code autocompletion
GNU Affero General Public License v3.0
117 stars 11 forks source link

Limit parallel jobs to 1 / use in-memeory pch storage #177

Closed cmaglie closed 5 months ago

cmaglie commented 5 months ago

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? Limit the number of concurrent indexing jobs on clangd

What is the current behavior? The number of concurrent jobs equals the number of available CPU cores. This may lead to unusable systems in some cases...

What is the new behavior? Limit the jobs to 1 core (2 threads if hyperthreaded).

Other information: Fix #176 (already confirmed by @facchinm)

kittaakos commented 5 months ago

@cmaglie, would you like me to create an IDE2 build for the verification with this LS? If yes, does this LS work with the 0.36.0-rc.x CLI API?

Please update the PR description with links to the corresponding clangd flags.

Don't we want to let users configure how many cores they wish to use for clangd? If yes, we should create an IDE2 preference and pass the -j value into the Arduino LS. What's your take on this?

Thank you!

cmaglie commented 5 months ago

would you like me to create an IDE2 build for the verification with this LS? If yes, does this LS work with the 0.36.0-rc.x CLI API?

No problem with that, I made the PR starting from the previous tagged version of the language server, and since I'm going to merge with a merge-commit I can make a release for both Arduino CLI 0.35.2 and 0.36.x.

Don't we want to let users configure how many cores they wish to use for clangd? If yes, we should create an IDE2 preference and pass the -j value into the Arduino LS. What's your take on this?

Good point, I will add a flag to set the number of threads on this PR

cmaglie commented 5 months ago

Released in 0.7.6, this version is compatible with Arduino CLI 0.35.2.

The current main is for the next Arduino CLI >=0.36.x.