summaryrefslogtreecommitdiff
path: root/cli/worker.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2023-03-08 22:21:14 +0530
committerGitHub <noreply@github.com>2023-03-08 22:21:14 +0530
commit0cce9c2bcc9667935a571d30847e66ef5d01a196 (patch)
tree3e188f47a7c8350a3f48fe5ec3a0b256351d41b9 /cli/worker.rs
parent06a12341c66e0a44436e1178603e0f398bfae10c (diff)
feat(core): prevent isolate drop for CLI main worker (#18059)
``` Benchmark 1: deno run -A ../empty.js Time (mean ± σ): 20.5 ms ± 0.5 ms [User: 13.4 ms, System: 5.1 ms] Range (min … max): 19.8 ms … 24.0 ms 119 runs Benchmark 2: target/release/deno run -A ../empty.js Time (mean ± σ): 18.8 ms ± 0.3 ms [User: 13.0 ms, System: 4.9 ms] Range (min … max): 18.3 ms … 19.9 ms 129 runs ``` --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/worker.rs')
-rw-r--r--cli/worker.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/cli/worker.rs b/cli/worker.rs
index 7ef90d79f..17d1d3c43 100644
--- a/cli/worker.rs
+++ b/cli/worker.rs
@@ -550,6 +550,7 @@ async fn create_main_worker_internal(
shared_array_buffer_store: Some(ps.shared_array_buffer_store.clone()),
compiled_wasm_module_store: Some(ps.compiled_wasm_module_store.clone()),
stdio,
+ leak_isolate: !bench_or_test && ps.options.coverage_dir().is_none(),
};
let mut worker = MainWorker::bootstrap_from_options(
@@ -780,6 +781,7 @@ mod tests {
shared_array_buffer_store: None,
compiled_wasm_module_store: None,
stdio: Default::default(),
+ leak_isolate: false,
};
MainWorker::bootstrap_from_options(main_module, permissions, options)