diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-06-14 13:58:20 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-06-14 13:56:36 -0700 |
commit | 1361e302234b17ab8079107b134dfd0ddf288439 (patch) | |
tree | a38ce903ddbd89ee2dfd437bd8f984cb1d85695b /core/shared_queue.js | |
parent | 3dff147d0ca1a2cd8d264d20a178d71cb38b1c4e (diff) |
Revert "Refactor dispatch handling (#2452)"
Due to performance regression:
https://github.com/denoland/deno/commit/dc60fe9f300043f191286ef804a365e16e455f87#commitcomment-33943711
This reverts commit dc60fe9f300043f191286ef804a365e16e455f87.
Diffstat (limited to 'core/shared_queue.js')
-rw-r--r-- | core/shared_queue.js | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/core/shared_queue.js b/core/shared_queue.js index b413f011e..75f370ce4 100644 --- a/core/shared_queue.js +++ b/core/shared_queue.js @@ -151,27 +151,14 @@ SharedQueue Binary Layout function handleAsyncMsgFromRust(buf) { if (buf) { - handleAsyncMsgFromRustInner(buf); + asyncHandler(buf); } else { while ((buf = shift()) != null) { - handleAsyncMsgFromRustInner(buf); + asyncHandler(buf); } } } - function handleAsyncMsgFromRustInner(buf) { - // DataView to extract cmdId value. - const dataView = new DataView(buf.buffer, buf.byteOffset, 4); - const promiseId = dataView.getInt32(0); - // Uint8 buffer view shifted right and shortened 4 bytes to remove cmdId from view window. - const bufViewFinal = new Uint8Array( - buf.buffer, - buf.byteOffset + 4, - buf.byteLength - 4 - ); - asyncHandler(promiseId, bufViewFinal); - } - function dispatch(control, zeroCopy = null) { maybeInit(); // First try to push control to shared. |