summaryrefslogtreecommitdiff
path: root/tools/benchmark.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/benchmark.py')
-rwxr-xr-xtools/benchmark.py25
1 files changed, 7 insertions, 18 deletions
diff --git a/tools/benchmark.py b/tools/benchmark.py
index 4055eca44..fd33863c9 100755
--- a/tools/benchmark.py
+++ b/tools/benchmark.py
@@ -10,10 +10,15 @@ import sys
import json
import time
import shutil
-from util import run, run_output, root_path, build_path, executable_suffix
+from util import run, run_output, root_path, build_path
import tempfile
import http_server
+try:
+ http_server.spawn()
+except:
+ "Warning: another http_server instance is running"
+
# The list of the tuples of the benchmark name and arguments
exec_time_benchmarks = [
("hello", ["tests/002_hello.ts"]),
@@ -49,19 +54,6 @@ def import_data_from_gh_pages():
write_json(data_file, []) # writes empty json data
-def get_binary_sizes(build_dir):
- path_dict = {
- "deno": os.path.join(build_dir, "deno" + executable_suffix),
- "main.js": os.path.join(build_dir, "gen/bundle/main.js"),
- "main.js.map": os.path.join(build_dir, "gen/bundle/main.js.map"),
- "snapshot_deno.bin": os.path.join(build_dir, "gen/snapshot_deno.bin")
- }
- sizes = {}
- for name, path in path_dict.items():
- sizes[name] = os.path.getsize(path)
- return sizes
-
-
def get_strace_summary_text(test_args):
f = tempfile.NamedTemporaryFile()
run(["strace", "-c", "-f", "-o", f.name] + test_args)
@@ -132,8 +124,6 @@ def main(argv):
print "Usage: tools/benchmark.py [build_dir]"
sys.exit(1)
- http_server.spawn()
-
deno_path = os.path.join(build_dir, "deno")
benchmark_file = os.path.join(build_dir, "benchmark.json")
@@ -149,7 +139,7 @@ def main(argv):
new_data = {
"created_at": time.strftime("%Y-%m-%dT%H:%M:%SZ"),
"sha1": sha1,
- "binary_size": {},
+ "binary_size": os.path.getsize(deno_path),
"thread_count": {},
"syscall_count": {},
"benchmark": {}
@@ -165,7 +155,6 @@ def main(argv):
"max": data["max"]
}
- new_data["binary_size"] = get_binary_sizes(build_dir)
if "linux" in sys.platform:
# Thread count test, only on linux
new_data["thread_count"] = run_thread_count_benchmark(deno_path)