num_cpus -> benri

This commit is contained in:
hinto.janai 2023-05-11 16:03:12 -04:00
parent 7d02dfadd0
commit 5eb64a9a3a
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
4 changed files with 10 additions and 3 deletions

7
Cargo.lock generated
View file

@ -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",

View file

@ -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"

View file

@ -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(),

View file

@ -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(),