summaryrefslogtreecommitdiff
path: root/cli/bench/http.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2021-04-09 00:34:15 +0200
committerGitHub <noreply@github.com>2021-04-08 18:34:15 -0400
commit70af8128767f2fc5a9c59107d3b5ddc00531db55 (patch)
tree48513959f16273eab2c4b743d61042b00a72deb8 /cli/bench/http.rs
parentb30ac9c5cf58c34ed71d2f470cdbcd86a6096987 (diff)
feat: native HTTP bindings (#9935)
Co-authered-by: Luca Casonato <lucacasonato@yahoo.com> Co-authered-by: Ben Noordhuis <info@bnoordhuis.nl> Co-authered-by: Ryan Dahl <ry@tinyclouds.org>
Diffstat (limited to 'cli/bench/http.rs')
-rw-r--r--cli/bench/http.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/cli/bench/http.rs b/cli/bench/http.rs
index 952f3f19b..690e26cf4 100644
--- a/cli/bench/http.rs
+++ b/cli/bench/http.rs
@@ -33,6 +33,7 @@ pub(crate) fn benchmark(
res.insert("deno_tcp".to_string(), deno_tcp(deno_exe)?);
// res.insert("deno_udp".to_string(), deno_udp(deno_exe)?);
res.insert("deno_http".to_string(), deno_http(deno_exe)?);
+ res.insert("deno_http_native".to_string(), deno_http_native(deno_exe)?);
// TODO(ry) deno_proxy disabled to make fetch() standards compliant.
// res.insert("deno_proxy".to_string(), deno_http_proxy(deno_exe) hyper_hello_exe))
res.insert(
@@ -200,6 +201,25 @@ fn deno_http(deno_exe: &str) -> Result<HttpBenchmarkResult> {
)
}
+fn deno_http_native(deno_exe: &str) -> Result<HttpBenchmarkResult> {
+ let port = get_port();
+ println!("http_benchmark testing DENO using native bindings.");
+ run(
+ &[
+ deno_exe,
+ "run",
+ "--allow-net",
+ "--reload",
+ "--unstable",
+ "cli/bench/deno_http_native.js",
+ &server_addr(port),
+ ],
+ port,
+ None,
+ None,
+ )
+}
+
#[allow(dead_code)]
fn deno_http_proxy(
deno_exe: &str,