Skip to content

Commit

Permalink
Enlarge IO thread pool
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Nov 11, 2023
1 parent 3297bdb commit 3c3166c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ use pacquet_diagnostics::enable_tracing_by_env;
use state::State;

pub async fn main() -> miette::Result<()> {
// We use rayon only for blocking syscalls, so we multiply the number of threads by 3.
rayon::ThreadPoolBuilder::new()
.num_threads(num_cpus::get() * 3)
.build_global()
.expect("build rayon thread pool");

enable_tracing_by_env();
set_panic_hook();
CliArgs::parse().run().await
Expand Down

0 comments on commit 3c3166c

Please sign in to comment.