Skip to content
Snippets Groups Projects
Unverified Commit d294c992 authored by Sean McArthur's avatar Sean McArthur Committed by GitHub
Browse files

Use logical CPUs instead of physical by default (#2391)

Some reasons to prefer logical count as the default:

- Chips reporting many logical CPUs vs physical, such as via
hyperthreading, probably know better than us about the workload the CPUs
can handle.
- The logical count (`num_cpus::get()`) takes into consideration
schedular affinity, and cgroups CPU quota, in case the user wants to
limit the amount of CPUs a process can use.

Closes #2269
parent 58ba45a3
No related branches found
No related tags found
No related merge requests found
......@@ -75,7 +75,7 @@ pub(crate) mod sync {
pub(crate) mod sys {
#[cfg(feature = "rt-threaded")]
pub(crate) fn num_cpus() -> usize {
usize::max(1, num_cpus::get_physical())
usize::max(1, num_cpus::get())
}
#[cfg(not(feature = "rt-threaded"))]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment