summaryrefslogtreecommitdiff
path: root/tools/http_benchmark.py
diff options
context:
space:
mode:
Diffstat (limited to '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])