diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2019-02-26 17:36:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-26 17:36:05 -0500 |
commit | b8a537d020f5e4495572daa4d8a59f51fa3b20d1 (patch) | |
tree | 468164b8dcc8ce0bcd64e75b63e4a3af0da36f15 /tools/http_benchmark.py | |
parent | 5dfbbbb07a8f484dca27bbe0d7a3bafb0bdb91fd (diff) |
deno_core (#1827)
A new low-level crate with focus on speed.
This doesn't yet hook into the existing code base.
Diffstat (limited to 'tools/http_benchmark.py')
-rwxr-xr-x | tools/http_benchmark.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tools/http_benchmark.py b/tools/http_benchmark.py index 312e61da6..d84a24de6 100755 --- a/tools/http_benchmark.py +++ b/tools/http_benchmark.py @@ -30,6 +30,16 @@ def deno_net_http_benchmark(deno_exe): }) +def deno_core_single(exe): + print "http_benchmark testing deno_core_single" + return run([exe, "--single-thread"]) + + +def deno_core_multi(exe): + print "http_benchmark testing deno_core_multi" + return run([exe, "--multi-thread"]) + + def node_http_benchmark(): node_cmd = ["node", "tools/node_http.js", ADDR.split(":")[1]] print "http_benchmark testing NODE." @@ -48,11 +58,13 @@ def hyper_http_benchmark(hyper_hello_exe): return run(hyper_cmd) -def http_benchmark(deno_exe, hyper_hello_exe): +def http_benchmark(deno_exe, hyper_hello_exe, core_http_bench_exe): r = {} # TODO Rename to "deno_tcp" r["deno"] = deno_http_benchmark(deno_exe) r["deno_net_http"] = deno_net_http_benchmark(deno_exe) + r["deno_core_single"] = deno_core_single(core_http_bench_exe) + r["deno_core_multi"] = deno_core_multi(core_http_bench_exe) r["node"] = node_http_benchmark() r["node_tcp"] = node_tcp_benchmark() r["hyper"] = hyper_http_benchmark(hyper_hello_exe) @@ -68,8 +80,14 @@ def run(server_cmd, merge_env=None): for key, value in merge_env.iteritems(): env[key] = value + # Wait for port 4544 to become available. + # TODO Need to use SO_REUSEPORT with tokio::net::TcpListener. + time.sleep(5) + server = subprocess.Popen(server_cmd, env=env) + time.sleep(5) # wait for server to wake up. TODO racy. + try: cmd = "third_party/wrk/%s/wrk -d %s http://%s/" % (util.platform(), DURATION, ADDR) |