-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Open
Labels
type-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Proposal:
Currently Python provides os.cpu_count()
which returns the total number of physical CPU cores.
On macOS M-class machines (and probably other ARM hardware), there are actually two types of CPU cores: performance cores, and efficiency cores.
For many tasks where a user wants to do "1 task per core", it really only makes sense to do 1 task per performance core.
Therefore it'd be sensible to expose this number. On macOS it can be found with the hw.perflevel0.logicalcpu
sysctl
.
This could be done in one of two ways, a new function, e.g. os.performance_cpu_count()
, or as a keyword-argument to os.cpu_count(performance_cores_only=True)
.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
AlexisMotet
Metadata
Metadata
Assignees
Labels
type-featureA feature request or enhancementA feature request or enhancement