diff options
Diffstat (limited to 'website')
-rw-r--r-- | website/all_benchmark.html | 47 | ||||
-rw-r--r-- | website/app.js | 18 | ||||
-rw-r--r-- | website/index.html | 8 |
3 files changed, 66 insertions, 7 deletions
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 @@ +<!-- Copyright 2018 the Deno authors. All rights reserved. MIT license. --> +<!DOCTYPE html> +<html> +<head> + <title>all benchmark data | deno</title> + <link rel="stylesheet" href="https://unpkg.com/c3@0.6.7/c3.min.css"> + <link rel="stylesheet" href="style.css"> + <meta content='width=device-width, initial-scale=1.0' name='viewport' /> +</head> +<body> + <main> + <h1>all benchmark data</h1> + + <p><a href="./">back</a> + + <h2>Execution time</h2> + <div id="exec-time-chart"></div> + + <h2>Throughput</h2> + <div id="throughput-chart"></div> + + <h2>Req/Sec</h2> + <div id="req-per-sec-chart"></div> + + <h2>Executable size</h2> + <div id="binary-size-chart"></div> + + <h2>Thread count</h2> + <div id="thread-count-chart"></div> + + <h2>Syscall count</h2> + <div id="syscall-count-chart"></div> + + <h2>Travis</h2> + <div id="travis-compile-time-chart"></div> + </main> + <script src="https://unpkg.com/d3@5.7.0/dist/d3.min.js"></script> + <script src="https://unpkg.com/c3@0.6.7/c3.min.js"></script> + + <script type="module"> + import { drawCharts } from "./app.js"; + window.chartWidth = 800 + drawCharts("./data.json"); + </script> +</body> +</html> + 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 @@ <h2>Travis</h2> How long for Travis CI to return a green status for pull requests. <div id="travis-compile-time-chart"></div> + + <h2>References</h2> + <p> <a href="./all_benchmark.html">All benchmark data</a> + </main> <script src="https://unpkg.com/d3@5.7.0/dist/d3.min.js"></script> <script src="https://unpkg.com/c3@0.6.7/c3.min.js"></script> <script type="module"> - import { main } from "./app.js"; - main(); + import { drawCharts } from "./app.js"; + drawCharts("./recent.json"); </script> </body> </html> |