diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2020-07-04 13:05:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-04 13:05:01 -0400 |
commit | 5f9e600c5bb78ae35a9a12d250f1d7cad79cf7a4 (patch) | |
tree | df0085e1287912f014bf804d2070f189a367b772 /tools/benchmark.py | |
parent | fca492907cb0e6b12f202681ccf36278b5bfa81a (diff) |
chore: port http_server.py to rust (#6364)
Diffstat (limited to 'tools/benchmark.py')
-rwxr-xr-x | tools/benchmark.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/benchmark.py b/tools/benchmark.py index c5200a281..47f9fd821 100755 --- a/tools/benchmark.py +++ b/tools/benchmark.py @@ -3,7 +3,7 @@ # Performs benchmark and append data to //website/data.json. # If //website/data.json doesn't exist, this script tries to import it from # gh-pages branch. -# To view the results locally run ./tools/http_server.py and visit +# To view the results locally run target/debug/test_server and visit # http://localhost:4545/website import os @@ -12,11 +12,11 @@ import json import time import tempfile import subprocess -from util import build_path, executable_suffix, root_path, run, run_output +from util import (build_path, executable_suffix, root_path, run, run_output, + build_mode) import third_party from http_benchmark import http_benchmark import throughput_benchmark -import http_server # The list of the tuples of the benchmark name, arguments and return code exec_time_benchmarks = [ @@ -239,7 +239,6 @@ def main(): build_dir = build_path() sha1 = run_output(["git", "rev-parse", "HEAD"], exit_on_fail=True).out.strip() - http_server.spawn() deno_exe = os.path.join(build_dir, "deno") @@ -253,7 +252,11 @@ def main(): # TODO(ry) The "benchmark" benchmark should actually be called "exec_time". # When this is changed, the historical data in gh-pages branch needs to be # changed too. + server_cmd = os.path.join("target", build_mode(), "test_server") + p = subprocess.Popen([server_cmd]) new_data["benchmark"] = run_exec_time(deno_exe, build_dir) + p.kill() + p.wait() new_data["binary_size"] = get_binary_sizes(build_dir) new_data["bundle_size"] = bundle_benchmark(deno_exe) |