From f356b2bd5e3d46eaf4147a38a2f7c7e7c2824fbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sun, 17 Nov 2019 14:14:50 +0100 Subject: refactor: fixes for futures (#3363) After landing #3358 the benchmarks exploded indicating problems with workers and deno_core_http_bench. This PR dramatically fixes thread/syscall count that showed up on benchmarks. Thread count is not back to previous levels but difference went from hundreds/thousands to about ~50. --- cli/compilers/wasm.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'cli/compilers/wasm.rs') diff --git a/cli/compilers/wasm.rs b/cli/compilers/wasm.rs index 30a171db4..882e28e43 100644 --- a/cli/compilers/wasm.rs +++ b/cli/compilers/wasm.rs @@ -86,14 +86,13 @@ impl WasmCompiler { let worker_ = worker.clone(); let url = source_file.url.clone(); + let _res = worker.post_message( + serde_json::to_string(&base64_data) + .unwrap() + .into_boxed_str() + .into_boxed_bytes(), + ); let fut = worker - .post_message( - serde_json::to_string(&base64_data) - .unwrap() - .into_boxed_str() - .into_boxed_bytes(), - ) - .then(move |_| worker) .then(move |result| { if let Err(err) = result { // TODO(ry) Need to forward the error instead of exiting. -- cgit v1.2.3