diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2018-09-22 01:06:59 +0900 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2018-09-22 01:09:25 -0700 |
commit | 3747ec57e097e1addfeb9c38da846b1ca7cbeb05 (patch) | |
tree | 983363b99f7c2cc4b5dcf64726b248b2093c566d /website/app.js | |
parent | 7a0670a9512981cee18d1960db46a3b57844595d (diff) |
Add benchmark tools (#777)
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 new file mode 100644 index 000000000..7a6566a61 --- /dev/null +++ b/website/app.js @@ -0,0 +1,26 @@ +const benchmarkNames = ["hello", "relative_import"]; + +(async () => { + const data = await (await fetch("./data.json")).json(); + + const benchmarkColumns = benchmarkNames.map(name => [ + name, + ...data.map(d => { + const benchmark = d.benchmark[name]; + return benchmark ? benchmark.mean : 0; + }) + ]); + + const sha1List = data.map(d => d.sha1); + + c3.generate({ + bindto: "#benchmark-chart", + data: { columns: benchmarkColumns }, + axis: { + x: { + type: "category", + categories: sha1List + } + } + }); +})(); |