Skip to main content

logical_parallelism

Function logical_parallelism 

Source
pub fn logical_parallelism() -> usize
Expand description

Logical processors this process should parallelize across.

Derived once and cached for the process lifetime. The topology cannot change while the process runs, and deriving it is not cheap: a CpuTopology::detect() call measures 9,935 ns and 77 allocations totalling 16,480 bytes on a 24-processor host, because it materializes the whole NUMA and cache-level description to read one count. Callers that need a worker count per operation must not pay that, so this is the one place the derivation happens.

themis reports the machine’s logical processors; available_parallelism is the fallback when no topology is available.