logo

Rust crates reviews

Cryptographically verifiable, distributed dependency reviews

crate: num_cpus

https://lib.rs/crates/num_cpus/

Add the last reviewed version to Cargo.toml / [dependencies]:

num_cpus = "1.13.0"

Filter reviews clicking on the numbers in the summary.

Full column names in tooltip hints: rating Negative, rating Neutral, rating Positive, rating Strong, thoroughness, understanding, reviews count.

Neg
Neu
Pos
Str
tho
und
rev
3
3
1
1
1
1
1
1
crate version
rating
date
reviewer
thoroughness, understanding
num_cpus 1.13.0
positive
2020-09-07
low, low

Queries the OS for the number of CPU cores you have.

Pros:

  • You didn't have to write it.
  • Handles all that hideously platform specific nonsense for you.

Cons:

  • Lots of (necessary) unsafe
  • Linux cgroups support seems wildly overcomplicated.
  • Lies and
    lies and
    lies and
    lies.
    Not exactly this crate's fault - the system APIs are brittle and full of edge cases.
    Multi-processor architectures are full of edge cases.

Alternatives:

  • Just hardcode a reasonable number of threads for your workload!
    Spinning up threads for 64 CPU cores to all false-share a single cacheline
    because that's how many logical cores were detected isn't the right choice!
    And all your threads are probably blocked on I/O anyways!

Full Audit

num_cpus 1.12.0
positive
2020-09-07
medium, medium

Queries the OS for the number of CPU cores you have.

Pros:

  • You didn't have to write it.
  • Handles all that hideously platform specific nonsense for you.

Cons:

  • Lots of (necessary) unsafe
  • Linux cgroups support seems wildly overcomplicated.
  • Lies and
    lies and
    lies and
    lies.
    Not exactly this crate's fault - the system APIs are brittle and full of edge cases.
    Multi-processor architectures are full of edge cases.

Alternatives:

  • Just hardcode a reasonable number of threads for your workload!
    Spinning up threads for 64 CPU cores to all false-share a single cacheline
    because that's how many logical cores were detected isn't the right choice!
    And all your threads are probably blocked on I/O anyways!

Full Audit

num_cpus 1.11.1
positive
2020-09-07
medium, medium
advisories:
medium

Queries the OS for the number of CPU cores you have.

Pros:

  • You didn't have to write it.
  • Handles all that hideously platform specific nonsense for you.

Cons:

  • Lots of (necessary) unsafe
  • Linux cgroups support seems wildly overcomplicated.
  • Lies and
    lies and
    lies and
    lies.
    Not exactly this crate's fault - the system APIs are brittle and full of edge cases.
    Multi-processor architectures are full of edge cases.

Alternatives:

  • Just hardcode a reasonable number of threads for your workload!
    Spinning up threads for 64 CPU cores to all false-share a single cacheline
    because that's how many logical cores were detected isn't the right choice!
    And all your threads are probably blocked on I/O anyways!

Full Audit

num_cpus 1.10.1
positive
2019-07-03
medium, medium

© bestia.dev 2023, MIT License, Version: 2023.608.1636

Open source repository for this web app: https://github.com/bestia-dev/cargo_crev_web/