summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBert Belder <bertbelder@gmail.com>2018-09-25 23:52:47 -0700
committerRyan Dahl <ry@tinyclouds.org>2018-09-26 08:35:12 -0400
commit3a6da19eb80c5959e0fe0ff00b093b9f7d85d618 (patch)
tree5ec030e9227b258f817f1399e508363404821abd
parent8c7416b3f666c62327a2306e955ec59823b1f239 (diff)
Revert "Expand binary size benchmark (#830)"
This reverts commit 8c7416b3f666c62327a2306e955ec59823b1f239.
-rwxr-xr-xtools/benchmark.py25
-rw-r--r--tools/benchmark_test.py11
-rwxr-xr-xtools/test.py2
-rw-r--r--website/app.js17
-rw-r--r--website/app_test.js30
5 files changed, 14 insertions, 71 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)
diff --git a/tools/benchmark_test.py b/tools/benchmark_test.py
index 42a3465b2..cdaad1e1f 100644
--- a/tools/benchmark_test.py
+++ b/tools/benchmark_test.py
@@ -19,14 +19,6 @@ def strace_parse_test():
assert summary["total"]["calls"] == 704
-def binary_size_test(build_dir):
- binary_size_dict = benchmark.get_binary_sizes(build_dir)
- assert binary_size_dict["deno"] > 0
- assert binary_size_dict["main.js"] > 0
- assert binary_size_dict["main.js.map"] > 0
- assert binary_size_dict["snapshot_deno.bin"] > 0
-
-
def thread_count_test(deno_path):
thread_count_dict = benchmark.run_thread_count_benchmark(deno_path)
assert "set_timeout" in thread_count_dict
@@ -39,9 +31,8 @@ def syscall_count_test(deno_path):
assert syscall_count_dict["hello"] > 1
-def benchmark_test(build_dir, deno_path):
+def benchmark_test(deno_path):
strace_parse_test()
- binary_size_test(build_dir)
if "linux" in sys.platform:
thread_count_test(deno_path)
syscall_count_test(deno_path)
diff --git a/tools/test.py b/tools/test.py
index 45c9f5e2b..ac3a5ca95 100755
--- a/tools/test.py
+++ b/tools/test.py
@@ -41,7 +41,7 @@ def main(argv):
# Internal tools testing
setup_test()
util_test()
- benchmark_test(build_dir, deno_exe)
+ benchmark_test(deno_exe)
test_cc = os.path.join(build_dir, "test_cc" + executable_suffix)
check_exists(test_cc)
diff --git a/website/app.js b/website/app.js
index 31aa99349..ab9dbb8a4 100644
--- a/website/app.js
+++ b/website/app.js
@@ -21,23 +21,8 @@ export function createExecTimeColumns(data) {
]);
}
-const binarySizeNames = ["deno", "main.js", "main.js.map", "snapshot_deno.bin"];
export function createBinarySizeColumns(data) {
- return binarySizeNames.map(name => [
- name,
- ...data.map(d => {
- const binarySizeData = d["binary_size"];
- switch (typeof binarySizeData) {
- case "number": // legacy implementation
- return name === "deno" ? binarySizeData : 0;
- default:
- if (!binarySizeData) {
- return 0;
- }
- return binarySizeData[name] || 0;
- }
- })
- ]);
+ return [["binary_size", ...data.map(d => d.binary_size || 0)]];
}
const threadCountNames = ["set_timeout", "fetch_deps"];
diff --git a/website/app_test.js b/website/app_test.js
index e0d1a4969..1468fce22 100644
--- a/website/app_test.js
+++ b/website/app_test.js
@@ -14,12 +14,7 @@ const regularData = [
{
created_at: "2018-01-01T01:00:00Z",
sha1: "abcdef",
- binary_size: {
- deno: 100000000,
- "main.js": 90000000,
- "main.js.map": 80000000,
- "snapshot_deno.bin": 70000000
- },
+ binary_size: 100000000,
benchmark: {
hello: {
mean: 0.05
@@ -45,12 +40,7 @@ const regularData = [
{
created_at: "2018-01-02T01:00:00Z",
sha1: "012345",
- binary_size: {
- deno: 100000001,
- "main.js": 90000001,
- "main.js.map": 80000001,
- "snapshot_deno.bin": 70000001
- },
+ binary_size: 110000000,
benchmark: {
hello: {
mean: 0.055
@@ -79,7 +69,6 @@ const irregularData = [
{
created_at: "2018-01-01T01:00:00Z",
sha1: "123",
- binary_size: {},
benchmark: {
hello: {},
relative_import: {},
@@ -92,7 +81,6 @@ const irregularData = [
{
created_at: "2018-02-01T01:00:00Z",
sha1: "456",
- binary_size: 100000000,
benchmark: {}
}
];
@@ -119,22 +107,12 @@ test(function createExecTimeColumnsIrregularData() {
test(function createBinarySizeColumnsRegularData() {
const columns = createBinarySizeColumns(regularData);
- assertEqual(columns, [
- ["deno", 100000000, 100000001],
- ["main.js", 90000000, 90000001],
- ["main.js.map", 80000000, 80000001],
- ["snapshot_deno.bin", 70000000, 70000001]
- ]);
+ assertEqual(columns, [["binary_size", 100000000, 110000000]]);
});
test(function createBinarySizeColumnsIrregularData() {
const columns = createBinarySizeColumns(irregularData);
- assertEqual(columns, [
- ["deno", 0, 100000000],
- ["main.js", 0, 0],
- ["main.js.map", 0, 0],
- ["snapshot_deno.bin", 0, 0]
- ]);
+ assertEqual(columns, [["binary_size", 0, 0]]);
});
test(function createThreadCountColumnsRegularData() {