summaryrefslogtreecommitdiff
path: root/cli/bench
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-04-03 19:01:02 +0200
committerGitHub <noreply@github.com>2023-04-03 19:01:02 +0200
commit51d3fb78ad2453e649d01bcc833ecfec1a05d685 (patch)
treea093cd2ad4faf1cb1fc069de8c406aeef69e1b5a /cli/bench
parent2846bbe0a3de0cc366006f97023ce146112c40c9 (diff)
refactor: remove "ext/flash" (#18578)
With https://github.com/denoland/deno/pull/18568 landed we no longer need "ext/flash". This commit removes "deno_flash" extension completely. This should have some impact on the binary and snapshot size. Closes https://github.com/denoland/deno/issues/17356
Diffstat (limited to 'cli/bench')
-rw-r--r--cli/bench/http/deno_http_flash_ops.js37
-rw-r--r--cli/bench/http/deno_http_flash_ops_spawn.js18
-rw-r--r--cli/bench/http/deno_http_flash_post_bin.js16
-rw-r--r--cli/bench/http/deno_http_flash_post_bin.lua5
-rw-r--r--cli/bench/http/deno_http_flash_spawn.js18
-rw-r--r--cli/bench/http/deno_http_serve.js (renamed from cli/bench/http/deno_http_flash.js)0
6 files changed, 0 insertions, 94 deletions
diff --git a/cli/bench/http/deno_http_flash_ops.js b/cli/bench/http/deno_http_flash_ops.js
deleted file mode 100644
index 7b024f9af..000000000
--- a/cli/bench/http/deno_http_flash_ops.js
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-
-// deno-lint-ignore-file
-
-const {
- 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 });
-const serverPromise = opAsync("op_flash_drive_server", serverId);
-
-const fastOps = op_flash_make_request();
-function nextRequest() {
- return fastOps.nextRequest();
-}
-function respond(token, response) {
- return fastOps.respond(token, response, true);
-}
-
-const response = encode(
- "HTTP/1.1 200 OK\r\nContent-Length: 11\r\n\r\nHello World",
-);
-let offset = 0;
-while (true) {
- let token = nextRequest();
- if (token === 0) token = await opAsync("op_flash_next_async", serverId);
- for (let i = offset; i < offset + token; i++) {
- respond(
- i,
- response,
- );
- }
- offset += token;
-}
diff --git a/cli/bench/http/deno_http_flash_ops_spawn.js b/cli/bench/http/deno_http_flash_ops_spawn.js
deleted file mode 100644
index b9d11462f..000000000
--- a/cli/bench/http/deno_http_flash_ops_spawn.js
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-
-if (Deno.build.os !== "linux") {
- throw new Error("SO_REUSEPORT is only supported on Linux");
-}
-
-const executable = Deno.execPath();
-const path = new URL("./deno_http_flash_ops.js", import.meta.url).pathname;
-// single flash instance runs on ~1.8 cores
-const cpus = navigator.hardwareConcurrency / 2;
-const processes = new Array(cpus);
-for (let i = 0; i < cpus; i++) {
- const proc = Deno.run({
- cmd: [executable, "run", "-A", "--unstable", path, Deno.args[0]],
- });
- processes.push(proc.status());
-}
-await Promise.all(processes);
diff --git a/cli/bench/http/deno_http_flash_post_bin.js b/cli/bench/http/deno_http_flash_post_bin.js
deleted file mode 100644
index b81553dcd..000000000
--- a/cli/bench/http/deno_http_flash_post_bin.js
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-
-const addr = Deno.args[0] || "127.0.0.1:4500";
-const [hostname, port] = addr.split(":");
-const { serve } = Deno;
-
-async function handler(request) {
- try {
- const buffer = await request.arrayBuffer();
- return new Response(buffer.byteLength);
- } catch (e) {
- console.log(e);
- }
-}
-
-serve(handler, { hostname, port });
diff --git a/cli/bench/http/deno_http_flash_post_bin.lua b/cli/bench/http/deno_http_flash_post_bin.lua
deleted file mode 100644
index c8f5d3e3f..000000000
--- a/cli/bench/http/deno_http_flash_post_bin.lua
+++ /dev/null
@@ -1,5 +0,0 @@
-wrk.method = "POST"
-wrk.headers["Content-Type"] = "application/octet-stream"
-
-file = io.open("./cli/bench/testdata/128k.bin", "rb")
-wrk.body = file:read("*a") \ No newline at end of file
diff --git a/cli/bench/http/deno_http_flash_spawn.js b/cli/bench/http/deno_http_flash_spawn.js
deleted file mode 100644
index e47acffc5..000000000
--- a/cli/bench/http/deno_http_flash_spawn.js
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-
-if (Deno.build.os !== "linux") {
- throw new Error("SO_REUSEPORT is only supported on Linux");
-}
-
-const executable = Deno.execPath();
-const path = new URL("./deno_http_flash.js", import.meta.url).pathname;
-// single flash instance runs on ~1.8 cores
-const cpus = navigator.hardwareConcurrency / 2;
-const processes = new Array(cpus);
-for (let i = 0; i < cpus; i++) {
- const proc = Deno.run({
- cmd: [executable, "run", "-A", "--unstable", path, Deno.args[0]],
- });
- processes.push(proc.status());
-}
-await Promise.all(processes);
diff --git a/cli/bench/http/deno_http_flash.js b/cli/bench/http/deno_http_serve.js
index a0db62630..a0db62630 100644
--- a/cli/bench/http/deno_http_flash.js
+++ b/cli/bench/http/deno_http_serve.js