summaryrefslogtreecommitdiff
path: root/cli/bench
diff options
context:
space:
mode:
Diffstat (limited to 'cli/bench')
-rw-r--r--cli/bench/async_ops.js2
-rw-r--r--cli/bench/deno_common.js6
-rw-r--r--cli/bench/http/deno_http_flash_ops.js10
-rw-r--r--cli/bench/http/deno_http_ops.js11
-rw-r--r--cli/bench/testdata/deno_upgrade_http.js4
5 files changed, 18 insertions, 15 deletions
diff --git a/cli/bench/async_ops.js b/cli/bench/async_ops.js
index d608e7a9e..fe041efe8 100644
--- a/cli/bench/async_ops.js
+++ b/cli/bench/async_ops.js
@@ -16,5 +16,5 @@ async function bench(fun) {
if (--total) queueMicrotask(() => bench(fun));
}
-const { ops } = Deno.core;
+const { ops } = Deno[Deno.internal].core;
bench(() => ops.op_void_async());
diff --git a/cli/bench/deno_common.js b/cli/bench/deno_common.js
index 2676fc8de..31ab05fba 100644
--- a/cli/bench/deno_common.js
+++ b/cli/bench/deno_common.js
@@ -8,7 +8,7 @@ Deno.bench("date_now", { n: 5e5 }, () => {
// Fast API calls
{
// deno-lint-ignore camelcase
- const { op_add } = Deno.core.ops;
+ const { op_add } = Deno[Deno.internal].core.ops;
// deno-lint-ignore no-inner-declarations
function add(a, b) {
return op_add(a, b);
@@ -22,7 +22,7 @@ Deno.bench("date_now", { n: 5e5 }, () => {
}
// deno-lint-ignore camelcase
-const { op_void_sync } = Deno.core.ops;
+const { op_void_sync } = Deno[Deno.internal].core.ops;
function sync() {
return op_void_sync();
}
@@ -34,7 +34,7 @@ Deno.bench("op_void_sync", () => sync());
Deno.bench(
"op_void_async",
{ n: 1e6 },
- () => Deno.core.opAsync("op_void_async"),
+ () => Deno[Deno.internal].core.opAsync("op_void_async"),
);
// A very lightweight op, that should be highly optimizable
diff --git a/cli/bench/http/deno_http_flash_ops.js b/cli/bench/http/deno_http_flash_ops.js
index 1ef2f65ed..7b024f9af 100644
--- a/cli/bench/http/deno_http_flash_ops.js
+++ b/cli/bench/http/deno_http_flash_ops.js
@@ -3,12 +3,10 @@
// deno-lint-ignore-file
const {
- core: {
- opAsync,
- ops: { op_flash_make_request, op_flash_serve },
- encode,
- },
-} = Deno;
+ opAsync,
+ ops: { op_flash_make_request, op_flash_serve },
+ encode,
+} = Deno[Deno.internal].core;
const addr = Deno.args[0] || "127.0.0.1:4500";
const [hostname, port] = addr.split(":");
const serverId = op_flash_serve({ hostname, port, reuseport: true });
diff --git a/cli/bench/http/deno_http_ops.js b/cli/bench/http/deno_http_ops.js
index 3fd0bef31..216a47905 100644
--- a/cli/bench/http/deno_http_ops.js
+++ b/cli/bench/http/deno_http_ops.js
@@ -13,7 +13,10 @@ class Http {
[Symbol.asyncIterator]() {
return {
next: async () => {
- const reqEvt = await Deno.core.opAsync("op_http_accept", this.id);
+ const reqEvt = await Deno[Deno.internal].core.opAsync(
+ "op_http_accept",
+ this.id,
+ );
return { value: reqEvt ?? undefined, done: reqEvt === null };
},
};
@@ -21,20 +24,20 @@ class Http {
}
for await (const conn of tcp) {
- const id = Deno.core.ops.op_http_start(conn.rid);
+ const id = Deno[Deno.internal].core.ops.op_http_start(conn.rid);
const http = new Http(id);
(async () => {
for await (const req of http) {
if (req == null) continue;
const { 0: stream } = req;
- await Deno.core.opAsync(
+ await Deno[Deno.internal].core.opAsync(
"op_http_write_headers",
stream,
200,
[],
"Hello World",
);
- Deno.core.close(stream);
+ Deno[Deno.internal].core.close(stream);
}
})();
}
diff --git a/cli/bench/testdata/deno_upgrade_http.js b/cli/bench/testdata/deno_upgrade_http.js
index db14f8589..ca5533411 100644
--- a/cli/bench/testdata/deno_upgrade_http.js
+++ b/cli/bench/testdata/deno_upgrade_http.js
@@ -1,5 +1,7 @@
const { serve, upgradeHttpRaw } = Deno;
-const u8 = Deno.core.encode("HTTP/1.1 101 Switching Protocols\r\n\r\n");
+const u8 = Deno[Deno.internal].core.encode(
+ "HTTP/1.1 101 Switching Protocols\r\n\r\n",
+);
async function handler(req) {
const [conn, _firstPacket] = upgradeHttpRaw(req);