Skip to content

Inconsistency for Num threads calculation if they don't specified #217

Open
@Ivanidzo4ka

Description

@Ivanidzo4ka

We have few places in code with code like:

_threads = Math.Max(1, args.Threads ?? (Environment.ProcessorCount / 2));

in some places it's Math.Max(2, Environment.ProcessorCount - 1)

in others it'sArgs.NumThreads ?? Environment.ProcessorCount;

which is a bit strange. It's either half of cores, all cores, or we left one core to be free.
KMeans, SdcaRegression, LinearClassifier , and BinaryLoader use half of available cores which leads to 50% CPU utilization.
@TomFinley, @GalOshri , @glebuk

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Doc bugs, questions, minor issues, etc.code-sanitationCode consistency, maintainability, and best practices, moreso than any public API.enhancementNew feature or requestperfPerformance and Benchmarking related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions