summaryrefslogtreecommitdiff
path: root/tools/benchmark.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/benchmark.py')
-rwxr-xr-xtools/benchmark.py11
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)