perf(core): async op pseudo-codegen and performance work (#18887)

Performance:

```
async_ops.js: 760k -> 1030k (!)
async_ops_deferred.js: 730k -> 770k
Deno.serve bench: 118k -> 124k
WS test w/ third_party/prebuilt/mac/load_test 100 localhost 8000 0 0: unchanged

Startup time: approx 0.5ms slower (13.7 -> 14.2ms)
```
This commit is contained in:
Matt Mastracci 2023-04-30 10:50:24 +02:00 committed by GitHub
parent 9c8ebce3dc
commit bb1f5e4262
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
45 changed files with 737 additions and 237 deletions

View file

@ -80,12 +80,14 @@ Deno.test(function metricsForOpCrates() {
// Test that op_names == Objects.keys(Deno[Deno.internal].core.ops)
// since building the per-op metrics depends on op_names being complete
Deno.test(function opNamesMatch() {
// @ts-ignore: Deno[Deno.internal].core allowed
const ops = Object.keys(Deno[Deno.internal].core.ops);
// @ts-ignore: Deno[Deno.internal].core allowed
ops.concat(Object.keys(Deno[Deno.internal].core.asyncOps));
assertEquals(
// @ts-ignore: Deno[Deno.internal].core allowed
Deno[Deno.internal].core.opNames().sort(),
// @ts-ignore: Deno[Deno.internal].core allowed
Object.keys(Deno[Deno.internal].core.ops).sort().filter((name) =>
name !== "asyncOpsInfo"
),
ops.sort().filter((name) => name !== "asyncOpsInfo"),
);
});