From 046cccfe1768837fcd5b4c1fd7d52fb2d98c0b11 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 5 Aug 2019 20:12:15 -0400 Subject: Remove dispatch optimization (#2732) Deno.core.dispatch() used to push the "control" buf onto the shared array buffer before calling into V8, with the idea that it was one less argument to parse. Turns out there is no more overhead passing the control ArrayBuffer directly over. Furthermore this optimization was making the refactors outlined in #2730 more complex. Therefore it is being removed. --- core/shared_queue.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'core/shared_queue.js') diff --git a/core/shared_queue.js b/core/shared_queue.js index d7ab382d6..1b338b052 100644 --- a/core/shared_queue.js +++ b/core/shared_queue.js @@ -165,11 +165,7 @@ SharedQueue Binary Layout function dispatch(control, zeroCopy = null) { maybeInit(); - // First try to push control to shared. - const success = push(control); - // If successful, don't use first argument of core.send. - const arg0 = success ? null : control; - return Deno.core.send(arg0, zeroCopy); + return Deno.core.send(control, zeroCopy); } const denoCore = { -- cgit v1.2.3