Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Nov 11, 2023
1 parent 3c3166c commit 8662d94
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ 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.
//
// If we are going to use rayon for CPU-bound tasks,
// we should create an extra threadpool for IO-bound tasks,
// and use the global theadpool for CPU-bound tasks.
rayon::ThreadPoolBuilder::new()
.num_threads(num_cpus::get() * 3)
.build_global()
Expand Down

0 comments on commit 8662d94

Please sign in to comment.