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

ScanCode should run with n-1 cores, instead of using all available resources #1062

Closed
maxhbr opened this issue Oct 21, 2021 · 4 comments · Fixed by #1070
Closed

ScanCode should run with n-1 cores, instead of using all available resources #1062

maxhbr opened this issue Oct 21, 2021 · 4 comments · Fixed by #1070
Labels
good first issue A good first issue to tackle if you are new to the project

Comments

@maxhbr
Copy link

maxhbr commented Oct 21, 2021

AFAIK it is recommended to run ScanCode with with one less core than is available. So it would be probably better to replace

command = "scancode -ilpcu --quiet --timeout 300 -n {} --json -".format(processes)

by

command = "scancode -ilpcu --quiet --timeout 300 -n {} --json -".format(processes - 1) 
@maxhbr
Copy link
Author

maxhbr commented Oct 21, 2021

@pombredanne: am I wrong about that?

@pombredanne
Copy link

@maxhbr ScanCode is happy to use it all, but it typically helps to use one less core to avoid saturating the CPU: this way it leaves some CPU cycles for the user. For instance on my laptop which is a quad core with 8 threads, I typically run with -n7.

@rnjudge rnjudge added the good first issue A good first issue to tackle if you are new to the project label Oct 21, 2021
@sayantani11
Copy link
Contributor

@rnjudge Can I take this? But I need a bit more explanation. @maxhbr

@rnjudge
Copy link
Contributor

rnjudge commented Oct 25, 2021

@sayantani11 go for it! The required change is just as suggested in Max's comment. It is a one liner.

sayantani11 added a commit to sayantani11/tern that referenced this issue Oct 26, 2021
It is recommended to run ScanCode with with
one less core than is available. Should
run n-1 core, instead of using all available
resources.

Resolves tern-tools#1062

Signed-off-by: Sayantani Saha <ii.sayantani.ii@gmail.com>
sayantani11 added a commit to sayantani11/tern that referenced this issue Oct 26, 2021
It is recommended to run ScanCode with with
one less core than is available. Should
run n-1 core, instead of using all available
resources.

Resolves tern-tools#1062

Signed-off-by: Sayantani Saha <ii.sayantani.ii@gmail.com>
sayantani11 added a commit to sayantani11/tern that referenced this issue Oct 26, 2021
It is recommended to run ScanCode with with
one less core than is available. Should
run n-1 core, instead of using all available
resources.

Resolves tern-tools#1062

Signed-off-by: Sayantani Saha <ii.sayantani.ii@gmail.com>
sayantani11 added a commit to sayantani11/tern that referenced this issue Oct 26, 2021
It is recommended to run ScanCode with with
one less core than is available. Should
run n-1 core, instead of using all available
resources.

Resolves tern-tools#1062

Signed-off-by: Sayantani Saha <ii.sayantani.ii@gmail.com>
rnjudge pushed a commit that referenced this issue Oct 26, 2021
It is recommended to run ScanCode with with
one less core than is available. Should
run n-1 core, instead of using all available
resources.

Resolves #1062

Signed-off-by: Sayantani Saha <ii.sayantani.ii@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue A good first issue to tackle if you are new to the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants