From f44ecdff975b637edb1c5d41d30a6924c8fd87d3 Mon Sep 17 00:00:00 2001 From: Yoshiya Hinosawa Date: Sat, 20 Oct 2018 16:56:24 +0900 Subject: feat: show only 20 benchmark data in inde.html --- .gitignore | 1 + tools/benchmark.py | 14 ++++++++------ website/all_benchmark.html | 47 ++++++++++++++++++++++++++++++++++++++++++++++ website/app.js | 18 +++++++++++++----- website/index.html | 8 ++++++-- 5 files changed, 75 insertions(+), 13 deletions(-) create mode 100644 website/all_benchmark.html diff --git a/.gitignore b/.gitignore index bd850eb16..98b064c7e 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ node_modules /gh-pages # temp benchmark data /website/data.json +/website/recent.json diff --git a/tools/benchmark.py b/tools/benchmark.py index 856ee3c85..943883f8f 100755 --- a/tools/benchmark.py +++ b/tools/benchmark.py @@ -25,7 +25,8 @@ exec_time_benchmarks = [ ] gh_pages_data_file = "gh-pages/data.json" -data_file = "website/data.json" +all_data_file = "website/data.json" # Includes all benchmark data. +recent_data_file = "website/recent.json" # Includes recent 20 benchmark data. def read_json(filename): @@ -39,16 +40,16 @@ def write_json(filename, data): def import_data_from_gh_pages(): - if os.path.exists(data_file): + if os.path.exists(all_data_file): return try: run([ "git", "clone", "--depth", "1", "-b", "gh-pages", "https://github.com/denoland/deno.git", "gh-pages" ]) - shutil.copy(gh_pages_data_file, data_file) + shutil.copy(gh_pages_data_file, all_data_file) except: - write_json(data_file, []) # writes empty json data + write_json(all_data_file, []) # writes empty json data def get_binary_sizes(build_dir): @@ -157,7 +158,7 @@ def main(argv): run(["hyperfine", "--export-json", benchmark_file, "--warmup", "3"] + [ deno_path + " " + " ".join(args) for [_, args] in exec_time_benchmarks ]) - all_data = read_json(data_file) + all_data = read_json(all_data_file) benchmark_data = read_json(benchmark_file) sha1 = run_output(["git", "rev-parse", "HEAD"]).strip() new_data = { @@ -191,7 +192,8 @@ def main(argv): new_data["syscall_count"] = run_syscall_count_benchmark(deno_path) all_data.append(new_data) - write_json(data_file, all_data) + write_json(all_data_file, all_data) + write_json(recent_data_file, all_data[-20:]) if __name__ == '__main__': diff --git a/website/all_benchmark.html b/website/all_benchmark.html new file mode 100644 index 000000000..9512143fc --- /dev/null +++ b/website/all_benchmark.html @@ -0,0 +1,47 @@ + + + + + all benchmark data | deno + + + + + +
+

all benchmark data

+ +

back + +

Execution time

+
+ +

Throughput

+
+ +

Req/Sec

+
+ +

Executable size

+
+ +

Thread count

+
+ +

Syscall count

+
+ +

Travis

+
+
+ + + + + + + diff --git a/website/app.js b/website/app.js index 8a2640b2f..c34cfc868 100644 --- a/website/app.js +++ b/website/app.js @@ -124,12 +124,17 @@ export function formatBytes(a, b) { return parseFloat((a / Math.pow(c, f)).toFixed(d)) + " " + e[f]; } +/** + * @param {string} id The id of dom element + * @param {any[][]} columns The columns data + * @param {string[]} categories The sha1 hashes (which work as x-axis values) + */ function gen2(id, categories, columns, onclick) { c3.generate({ bindto: id, size: { height: 300, - width: 375 + width: window.chartWidth || 375 // TODO: do not use global variable }, data: { columns, @@ -154,16 +159,19 @@ export function formatSeconds(t) { return a < 30 ? `${min} min` : `${min + 1} min`; } -export function main() { - drawChartsFromBenchmarkData(); +/** + * @param dataUrl The url of benchramk data json. + */ +export function drawCharts(dataUrl) { + drawChartsFromBenchmarkData(dataUrl); drawChartsFromTravisData(); } /** * Draws the charts from the benchmark data stored in gh-pages branch. */ -export async function drawChartsFromBenchmarkData() { - const data = await getJson("./data.json"); +export async function drawChartsFromBenchmarkData(dataUrl) { + const data = await getJson(dataUrl); const execTimeColumns = createExecTimeColumns(data); const throughputColumns = createThroughputColumns(data); diff --git a/website/index.html b/website/index.html index 7b3b2a05b..b5357b691 100644 --- a/website/index.html +++ b/website/index.html @@ -48,13 +48,17 @@

Travis

How long for Travis CI to return a green status for pull requests.
+ +

References

+

All benchmark data + -- cgit v1.2.3