mirror of
https://github.com/denoland/deno.git
synced 2025-08-01 17:42:32 +00:00
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.
This commit is contained in:
parent
2b3afda625
commit
f356b2bd5e
5 changed files with 32 additions and 29 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue