Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
deno
提交
1aa7e18b
D
deno
项目概览
张重言
/
deno
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
deno
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1aa7e18b
编写于
10月 07, 2018
作者:
Y
Yoshiya Hinosawa
提交者:
Ryan Dahl
10月 06, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: stop hard coding some of benchmark names
上级
48923f48
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
41 addition
and
38 deletion
+41
-38
website/README.md
website/README.md
+10
-2
website/app.js
website/app.js
+10
-17
website/app_test.js
website/app_test.js
+21
-19
未找到文件。
website/README.md
浏览文件 @
1aa7e18b
## About benchmark data
The benchmark chart supposes
`//website/data.json`
has the
signature of
The benchmark chart supposes
`//website/data.json`
has the
type
`BenchmarkData[]`
where
`BenchmarkData`
is defined like the below:
```
typescript
...
...
@@ -16,9 +16,17 @@ interface ExecTimeData {
interface
BenchmarkData
{
created_at
:
string
;
sha1
:
string
;
binary_size
?:
number
;
benchmark
:
{
[
key
:
string
]:
ExecTimeData
;
};
binarySizeData
:
{
[
key
:
string
]:
number
;
};
threadCountData
:
{
[
key
:
string
]:
number
;
};
syscallCountData
:
{
[
key
:
string
]:
number
;
};
}
```
website/app.js
浏览文件 @
1aa7e18b
...
...
@@ -16,13 +16,8 @@ export function getTravisData() {
.
then
(
data
=>
data
.
builds
.
reverse
());
}
const
benchmarkNames
=
[
"
hello
"
,
"
relative_import
"
,
"
cold_hello
"
,
"
cold_relative_import
"
];
export
function
createExecTimeColumns
(
data
)
{
const
benchmarkNames
=
Object
.
keys
(
data
[
data
.
length
-
1
].
benchmark
);
return
benchmarkNames
.
map
(
name
=>
[
name
,
...
data
.
map
(
d
=>
{
...
...
@@ -33,8 +28,9 @@ export function createExecTimeColumns(data) {
]);
}
const
binarySizeNames
=
[
"
deno
"
,
"
main.js
"
,
"
main.js.map
"
,
"
snapshot_deno.bin
"
];
export
function
createBinarySizeColumns
(
data
)
{
const
propName
=
"
binary_size
"
;
const
binarySizeNames
=
Object
.
keys
(
data
[
data
.
length
-
1
][
propName
]);
return
binarySizeNames
.
map
(
name
=>
[
name
,
...
data
.
map
(
d
=>
{
...
...
@@ -52,12 +48,13 @@ export function createBinarySizeColumns(data) {
]);
}
const
threadCountNames
=
[
"
set_timeout
"
,
"
fetch_deps
"
];
export
function
createThreadCountColumns
(
data
)
{
const
propName
=
"
thread_count
"
;
const
threadCountNames
=
Object
.
keys
(
data
[
data
.
length
-
1
][
propName
]);
return
threadCountNames
.
map
(
name
=>
[
name
,
...
data
.
map
(
d
=>
{
const
threadCountData
=
d
[
"
thread_count
"
];
const
threadCountData
=
d
[
propName
];
if
(
!
threadCountData
)
{
return
null
;
}
...
...
@@ -66,12 +63,13 @@ export function createThreadCountColumns(data) {
]);
}
const
syscallCountNames
=
[
"
hello
"
,
"
fetch_deps
"
];
export
function
createSyscallCountColumns
(
data
)
{
const
propName
=
"
syscall_count
"
;
const
syscallCountNames
=
Object
.
keys
(
data
[
data
.
length
-
1
][
propName
]);
return
syscallCountNames
.
map
(
name
=>
[
name
,
...
data
.
map
(
d
=>
{
const
syscallCountData
=
d
[
"
syscall_count
"
];
const
syscallCountData
=
d
[
propName
];
if
(
!
syscallCountData
)
{
return
null
;
}
...
...
@@ -80,13 +78,8 @@ export function createSyscallCountColumns(data) {
]);
}
const
travisCompileTimeNames
=
[
"
duration_time
"
];
function
createTravisCompileTimeColumns
(
data
)
{
const
columnsData
=
travisCompileTimeNames
.
map
(
name
=>
[
name
,
...
data
.
map
(
d
=>
d
.
duration
)
]);
return
columnsData
;
return
[[
"
duration_time
"
,
...
data
.
map
(
d
=>
d
.
duration
)]];
}
export
function
createSha1List
(
data
)
{
...
...
website/app_test.js
浏览文件 @
1aa7e18b
...
...
@@ -83,21 +83,31 @@ const irregularData = [
{
created_at
:
"
2018-01-01T01:00:00Z
"
,
sha1
:
"
123
"
,
benchmark
:
{},
binary_size
:
{},
thread_count
:
{},
syscall_count
:
{}
},
{
created_at
:
"
2018-02-01T01:00:00Z
"
,
sha1
:
"
456
"
,
benchmark
:
{
hello
:
{},
relative_import
:
{},
cold_hello
:
{},
cold_relative_import
:
{}
},
thread_count
:
{},
syscall_count
:
{}
binary_size
:
{
deno
:
1
},
{
created_at
:
"
2018-02-01T01:00:00Z
"
,
sha1
:
"
456
"
,
binary_size
:
100000000
,
benchmark
:
{}
thread_count
:
{
set_timeout
:
5
,
fetch_deps
:
7
},
syscall_count
:
{
hello
:
700
,
fetch_deps
:
800
}
}
];
...
...
@@ -133,12 +143,7 @@ test(function createBinarySizeColumnsRegularData() {
test
(
function
createBinarySizeColumnsIrregularData
()
{
const
columns
=
createBinarySizeColumns
(
irregularData
);
assertEqual
(
columns
,
[
[
"
deno
"
,
null
,
100000000
],
[
"
main.js
"
,
null
,
0
],
[
"
main.js.map
"
,
null
,
0
],
[
"
snapshot_deno.bin
"
,
null
,
0
]
]);
assertEqual
(
columns
,
[[
"
deno
"
,
null
,
1
]]);
});
test
(
function
createThreadCountColumnsRegularData
()
{
...
...
@@ -148,10 +153,7 @@ test(function createThreadCountColumnsRegularData() {
test
(
function
createThreadCountColumnsIrregularData
()
{
const
columns
=
createThreadCountColumns
(
irregularData
);
assertEqual
(
columns
,
[
[
"
set_timeout
"
,
null
,
null
],
[
"
fetch_deps
"
,
null
,
null
]
]);
assertEqual
(
columns
,
[[
"
set_timeout
"
,
null
,
5
],
[
"
fetch_deps
"
,
null
,
7
]]);
});
test
(
function
createSyscallCountColumnsRegularData
()
{
...
...
@@ -161,7 +163,7 @@ test(function createSyscallCountColumnsRegularData() {
test
(
function
createSyscallCountColumnsIrregularData
()
{
const
columns
=
createSyscallCountColumns
(
irregularData
);
assertEqual
(
columns
,
[[
"
hello
"
,
null
,
null
],
[
"
fetch_deps
"
,
null
,
null
]]);
assertEqual
(
columns
,
[[
"
hello
"
,
null
,
700
],
[
"
fetch_deps
"
,
null
,
800
]]);
});
test
(
function
createSha1ListRegularData
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录