-
Notifications
You must be signed in to change notification settings - Fork 234
When using "-n auto", count the number of physical CPU cores instead of logical ones #553
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
Comments
+1 |
Psutil has not been considered as dependency yet |
For what it's worth this would be very useful for me too, and I wouldn't mind adding a dependency on |
@RonnyPfannschmidt anything against depending on Even if we decide to no depend on it explicitly, we can optionally use |
There ist nothin against it |
Guys you changed something important there, now, how can we specify $(nproc) in pytest.ini or pyproject.toml ? maybe a better option like "-n [auto|ncpus|ncores|{n}]" could be nice ? |
Hi @AdrienPensart,
|
I have a laptop with 6 physical CPU cores and hyper-threading. The code from auto_detect_cpus gives 12:
The optimal number of parallel processes though is 6. Tests run slower when using 12 processes.
Did you consider using
psutil.cpu_count(logical=False)
?The text was updated successfully, but these errors were encountered: