summaryrefslogtreecommitdiff
path: root/cli/tokio_util.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2020-08-31 17:38:25 -0400
committerGitHub <noreply@github.com>2020-08-31 17:38:25 -0400
commit4b5d8bdbaf408042927ef78305f6354721b835fd (patch)
tree49e7ce64b37cf94bd0dd5ffe3798627e777caa7f /cli/tokio_util.rs
parent32de714dc72ad865a625d417cf7af95dbc31b798 (diff)
set maximum size of thread pool to 31 (#7290)
Diffstat (limited to 'cli/tokio_util.rs')
-rw-r--r--cli/tokio_util.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/cli/tokio_util.rs b/cli/tokio_util.rs
index e477cd5ee..b25a2994f 100644
--- a/cli/tokio_util.rs
+++ b/cli/tokio_util.rs
@@ -5,6 +5,12 @@ pub fn create_basic_runtime() -> tokio::runtime::Runtime {
.basic_scheduler()
.enable_io()
.enable_time()
+ // This limits the number of threads for blocking operations (like for
+ // synchronous fs ops) or CPU bound tasks like when we run dprint in
+ // parallel for deno fmt.
+ // The default value is 512, which is an unhelpfully large thread pool. We
+ // don't ever want to have more than a couple dozen threads.
+ .max_threads(32)
.build()
.unwrap()
}