summaryrefslogtreecommitdiff
path: root/website
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2019-07-28 12:11:08 +0200
committerRyan Dahl <ry@tinyclouds.org>2019-07-28 10:11:08 +0000
commit187310a3e151303504a1dc5830334ae7ac1fef57 (patch)
treecd0add94dc0c4fa8ce7cd2e60a26c537e11ed239 /website
parent877e5ed7844a1754080ddff9c095ed941072775f (diff)
benchmarks: add bundle size (#2690)
Diffstat (limited to 'website')
-rw-r--r--website/app.ts10
-rw-r--r--website/benchmarks.html25
2 files changed, 34 insertions, 1 deletions
diff --git a/website/app.ts b/website/app.ts
index c93ed0986..326e02f63 100644
--- a/website/app.ts
+++ b/website/app.ts
@@ -108,10 +108,18 @@ export function createSyscallCountColumns(data) {
]);
}
+export function createBundleSizeColumns(data) {
+ return createColumns(data, "bundle_size");
+}
+
export function createSha1List(data) {
return data.map(d => d.sha1);
}
+export function formatKB(bytes) {
+ return (bytes / 1024).toFixed(2);
+}
+
export function formatMB(bytes) {
return (bytes / (1024 * 1024)).toFixed(2);
}
@@ -247,6 +255,7 @@ export async function drawChartsFromBenchmarkData(dataUrl) {
const binarySizeColumns = createBinarySizeColumns(data);
const threadCountColumns = createThreadCountColumns(data);
const syscallCountColumns = createSyscallCountColumns(data);
+ const bundleSizeColumns = createBundleSizeColumns(data);
const sha1List = createSha1List(data);
const sha1ShortList = sha1List.map(sha1 => sha1.substring(0, 6));
@@ -277,6 +286,7 @@ export async function drawChartsFromBenchmarkData(dataUrl) {
gen("#binary-size-chart", binarySizeColumns, "megabytes", formatMB);
gen("#thread-count-chart", threadCountColumns, "threads");
gen("#syscall-count-chart", syscallCountColumns, "syscalls");
+ gen("#bundle-size-chart", bundleSizeColumns, "kilobytes", formatKB);
}
export function main(): void {
diff --git a/website/benchmarks.html b/website/benchmarks.html
index 8b2b44d72..68e1fa57d 100644
--- a/website/benchmarks.html
+++ b/website/benchmarks.html
@@ -221,11 +221,34 @@
<p>How many threads various programs use.</p>
<div id="thread-count-chart"></div>
- <h3 id="syscalls">Syscall count <a href="#syscalls">#</a></h3>
+ <h3 id="bundles">Syscall count <a href="#bundles">#</a></h3>
<p>
How many total syscalls are performed when executing a given script.
</p>
<div id="syscall-count-chart"></div>
+
+ <h3 id="bundles">Bundle size <a href="#syscalls">#</a></h3>
+ <p>
+ Size of different bundled scripts.
+ </p>
+
+ <ul>
+ <li>
+ <a
+ href="https://deno.land/std/http/file_server.ts"
+ >file_server</a
+ >
+ </li>
+
+ <li>
+ <a
+ href="https://deno.land/std/examples/gist.ts"
+ >gist</a
+ >
+ </li>
+ </ul>
+
+ <div id="bundle-size-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>