-
Notifications
You must be signed in to change notification settings - Fork 5.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deno.core.dispatch uses op name instead of id #6395
Conversation
@@ -1,7 +1,6 @@ | |||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. | |||
import * as util from "../util.ts"; | |||
import { core } from "../core.ts"; | |||
import { OPS_CACHE } from "../runtime.ts"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removes OPS_CACHE
indirection which was once problematic place when trying to snapshot ES modules
@@ -1,22 +1,12 @@ | |||
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. | |||
|
|||
import { sendAsyncMinimal, sendSyncMinimal } from "./dispatch_minimal.ts"; | |||
// TODO(bartlomieju): remove this import and maybe lazy-initialize | |||
// OPS_CACHE that belongs only to this module | |||
import { OPS_CACHE } from "../runtime.ts"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
Object.assign(window.Deno.core, { | ||
setAsyncHandler, | ||
dispatch: send, | ||
dispatchByName: dispatch, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name to be determined
core/core.js
Outdated
@@ -181,9 +183,14 @@ SharedQueue Binary Layout | |||
} | |||
} | |||
|
|||
function dispatch(opName, control, zeroCopy) { | |||
return send(opsCache[opName], control, zeroCopy); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worth to do an assert that resulting opId
is not undefined?
for (const [name, opId] of Object.entries(opsMap)) { | ||
core.setAsyncHandler(opId, getAsyncHandler(name)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Async handler registration is the last API bit that's a bit strange IMO and could be structured better
Benchmarks
|
Probably need a couple of other samples from benchmarks in order to draw any conclusions. I would suggest doing a release build locally and hitting tools/deno_tcp.ts with wrk manually to get a better sense. |
@ry sure, here are better benchmarks Benchmark:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - let's try it. I want to see how the benchmarks look over time, but I think this makes sense.
No description provided.