summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-10-16 21:02:16 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-10-17 16:02:00 -0400
commit21bcdd49cd4623691fe5b5f42a67095740af94c6 (patch)
tree54d863e5cc1fa37dc6a691b9636474caa3eae155
parent32f07971284f05993cf702aa589859e7900406b4 (diff)
Only run deno during ./tools/http_benchmark.py
-rwxr-xr-xtools/http_benchmark.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/tools/http_benchmark.py b/tools/http_benchmark.py
index 0cfdc988c..b1be79eda 100755
--- a/tools/http_benchmark.py
+++ b/tools/http_benchmark.py
@@ -10,15 +10,21 @@ ADDR = "127.0.0.1:4544"
DURATION = "10s"
-def http_benchmark(deno_exe):
+def deno_http_benchmark(deno_exe):
deno_cmd = [deno_exe, "--allow-net", "tests/http_bench.ts", ADDR]
- node_cmd = ["node", "tools/node_http.js", ADDR.split(":")[1]]
-
print "http_benchmark testing DENO."
- deno_rps = run(deno_cmd)
+ return run(deno_cmd)
+
+def node_http_benchmark(deno_exe):
+ node_cmd = ["node", "tools/node_http.js", ADDR.split(":")[1]]
print "http_benchmark testing NODE."
- node_rps = run(node_cmd)
+ return run(node_cmd)
+
+
+def http_benchmark(deno_exe):
+ deno_rps = deno_http_benchmark(deno_exe)
+ node_rps = node_http_benchmark(deno_exe)
return {"deno": deno_rps, "node": node_rps}
@@ -46,4 +52,4 @@ if __name__ == '__main__':
if len(sys.argv) < 2:
print "Usage ./tools/tcp_http_benchmark.py out/debug/deno"
sys.exit(1)
- http_benchmark(sys.argv[1])
+ deno_http_benchmark(sys.argv[1])