Skip to content

Commit 63e97a4

Browse files
authored
num_threads = available_concurrency (#887)
1 parent a0a18dd commit 63e97a4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/core/src/host/host_controller.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ impl HostThreadpool {
6161
let inner = rayon_core::ThreadPoolBuilder::new()
6262
.thread_name(|_idx| "rayon-worker".to_string())
6363
.spawn_handler(thread_spawn_handler(tokio::runtime::Handle::current()))
64-
// TODO(perf, pgoldman 2024-02-22): This seems like an obviously bad choice for the number of threads,
65-
// as in the case where we have many modules running many reducers,
64+
// TODO(perf, pgoldman 2024-02-22):
65+
// in the case where we have many modules running many reducers,
6666
// we'll wind up with Rayon threads competing with each other and with Tokio threads
6767
// for CPU time.
6868
//
@@ -72,7 +72,7 @@ impl HostThreadpool {
7272
// and Rayon threads to the other.
7373
// Then we should give Tokio and Rayon each a number of worker threads
7474
// equal to the size of their pool.
75-
.num_threads(std::thread::available_parallelism().unwrap().get() * 2)
75+
.num_threads(std::thread::available_parallelism().unwrap().get())
7676
.build()
7777
.unwrap();
7878
Self { inner }

0 commit comments

Comments
 (0)