diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-04-23 10:51:40 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-04-23 10:51:40 +0300 |
commit | 5809e6a2c8383537b7cfbb2d7a17d9b1314f4c55 (patch) | |
tree | 134f4b157ccf8b85641f12ea1f40175f5fc0cd14 | |
parent | 2daa99223ad6b382038acfe2f5646cdd94ff2d10 (diff) | |
download | summain-rs-5809e6a2c8383537b7cfbb2d7a17d9b1314f4c55.tar.gz |
numcpus
-rw-r--r-- | Cargo.lock | 1 | ||||
-rw-r--r-- | Cargo.toml | 1 | ||||
-rw-r--r-- | src/bin/summain.rs | 4 |
3 files changed, 4 insertions, 2 deletions
@@ -411,6 +411,7 @@ version = "0.26.0" dependencies = [ "anyhow", "digest", + "num_cpus", "serde", "serde_yaml", "sha2", @@ -13,6 +13,7 @@ edition = "2018" [dependencies] anyhow = "1" digest = "0.9" +num_cpus = "1" serde = { version = "1", features = ["derive"] } serde_yaml = "0.8" sha2 = "0.9" diff --git a/src/bin/summain.rs b/src/bin/summain.rs index 8ec14f8..110d228 100644 --- a/src/bin/summain.rs +++ b/src/bin/summain.rs @@ -5,8 +5,8 @@ use summain::ManifestEntry; fn main() -> anyhow::Result<()> { let runtime = tokio::runtime::Builder::new_multi_thread() - .worker_threads(16) - .max_blocking_threads(16) + .worker_threads(2) + .max_blocking_threads(num_cpus::get()) .build()?; runtime.block_on(async { async_main().await })?; Ok(()) |