diff --git a/Cargo.lock b/Cargo.lock index 9130280..00a661f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -343,6 +343,12 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "benri" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf749a9459ea5ea4feb27b10368e6e86217274d64bcb8a0409e785c9bdf591d" + [[package]] name = "bit-set" version = "0.5.3" @@ -1956,6 +1962,7 @@ dependencies = [ "anyhow", "arti-client", "arti-hyper", + "benri", "bytes", "dirs", "eframe", diff --git a/Cargo.toml b/Cargo.toml index bbf7de4..36d86c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,7 @@ distro = [] anyhow = "1.0.65" arti-client = { version = "0.7.0", features = ["static"] } arti-hyper = "0.7.0" +benri = "0.1.6" bytes = "1.2.1" dirs = "4.0.0" #-------------------------------------------------------------------------------- @@ -47,7 +48,6 @@ hyper = "0.14.20" hyper-tls = "0.5.0" image = { version = "0.24.4", features = ["png"] } log = "0.4.17" -num_cpus = "1.13.1" num-format = { version = "0.4.3", default-features = false } once_cell = "1.17.1" portable-pty = "0.7.0" diff --git a/src/disk.rs b/src/disk.rs index 07c3595..a2fa137 100644 --- a/src/disk.rs +++ b/src/disk.rs @@ -220,7 +220,7 @@ impl Default for State { impl State { pub fn new() -> Self { - let max_threads = num_cpus::get(); + let max_threads = benri::threads!(); let current_threads = if max_threads == 1 { 1 } else { max_threads / 2 }; Self { status: Status::default(), diff --git a/src/main.rs b/src/main.rs index da80bef..dc639cd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -248,7 +248,7 @@ impl App { pub_sys, benchmarks, pid, - max_threads: num_cpus::get(), + max_threads: benri::threads!(), now, admin: false, exe: String::new(),