diff options
author | Kevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com> | 2018-09-24 18:12:52 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-09-24 18:12:52 -0400 |
commit | 1729bdb0d7f504436cacc07bedba642591fdb0cb (patch) | |
tree | 8d9fb23ef2b942e8df6fea7b6637185fa1a0d709 /website/app.js | |
parent | d6a97ae4f02a7150165877e304778c96b90ddd5a (diff) |
Add thread count benchmark (#811)
Diffstat (limited to 'website/app.js')
-rw-r--r-- | website/app.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/website/app.js b/website/app.js index 612cc7af0..27baa1958 100644 --- a/website/app.js +++ b/website/app.js @@ -20,6 +20,20 @@ export function createBinarySizeColumns(data) { return [["binary_size", ...data.map(d => d.binary_size || 0)]]; } +const threadCountNames = ["set_timeout"]; +export function createThreadCountColumns(data) { + return threadCountNames.map(name => [ + name, + ...data.map(d => { + const threadCountData = d["thread_count"]; + if (!threadCountData) { + return 0; + } + return threadCountData[name] || 0; + }) + ]); +} + export function createSha1List(data) { return data.map(d => d.sha1); } @@ -40,6 +54,7 @@ export async function main() { const execTimeColumns = createExecTimeColumns(data); const binarySizeColumns = createBinarySizeColumns(data); + const threadCountColumns = createThreadCountColumns(data); const sha1List = createSha1List(data); c3.generate({ @@ -68,4 +83,15 @@ export async function main() { } } }); + + c3.generate({ + bindto: "#thread-count-chart", + data: { columns: threadCountColumns }, + axis: { + x: { + type: "category", + categories: sha1List + } + } + }); } |