Skip to content

Commit b677c77

Browse files
committed
TEST: Drop num_cpus as benchmark dev-dependency
We don't need another dep just to have faster rayon benchmarks (they are for comparison anyway.)
1 parent b3c8fe7 commit b677c77

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ serde = { version = "1.0", optional = true }
4545
defmac = "0.2"
4646
quickcheck = { version = "0.7.2", default-features = false }
4747
rawpointer = "0.1"
48-
num_cpus = "1.2"
4948

5049
[features]
5150
# Enable blas usage

benches/par_rayon.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ extern crate itertools;
99
use ndarray::prelude::*;
1010
use ndarray::parallel::prelude::*;
1111

12-
extern crate num_cpus;
1312
extern crate test;
1413
use test::Bencher;
1514

@@ -21,9 +20,10 @@ const ADDN: usize = 512;
2120
use std::cmp::max;
2221

2322
fn set_threads() {
24-
let n = max(1, num_cpus::get() / 2);
25-
//println!("Using {} threads", n);
26-
let _ = rayon::ThreadPoolBuilder::new().num_threads(n).build_global();
23+
// Consider setting a fixed number of threads here, for example to avoid
24+
// oversubscribing on hyperthreaded cores.
25+
// let n = 4;
26+
// let _ = rayon::ThreadPoolBuilder::new().num_threads(n).build_global();
2727
}
2828

2929
#[bench]

0 commit comments

Comments
 (0)