Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
deno
提交
63e1a4cf
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,发现更多精彩内容 >>
未验证
提交
63e1a4cf
编写于
9月 15, 2019
作者:
B
Bert Belder
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
tools: do not use 'find_exts()' in benchmarks.py (#2950)
上级
fbfd895b
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
25 addition
and
25 deletion
+25
-25
tools/benchmark.py
tools/benchmark.py
+25
-25
未找到文件。
tools/benchmark.py
浏览文件 @
63e1a4cf
...
...
@@ -13,8 +13,7 @@ import time
import
shutil
import
tempfile
import
subprocess
from
util
import
find_exts
,
root_path
,
run
,
run_output
from
util
import
build_path
,
executable_suffix
from
util
import
build_path
,
executable_suffix
,
root_path
,
run
,
run_output
import
third_party
from
http_benchmark
import
http_benchmark
import
throughput_benchmark
...
...
@@ -60,30 +59,31 @@ def import_data_from_gh_pages():
def
get_binary_sizes
(
build_dir
):
# Because cargo's OUT_DIR is not predictable, we have to search the build
# tree for these files...
files
=
find_exts
([
build_dir
],
[
"js"
,
"map"
,
"bin"
])
path_dict
=
{
"deno"
:
os
.
path
.
join
(
build_dir
,
"deno"
+
executable_suffix
),
}
for
f
in
files
:
if
f
.
endswith
(
"CLI_SNAPSHOT.js"
):
path_dict
[
"CLI_SNAPSHOT.js"
]
=
f
elif
f
.
endswith
(
"CLI_SNAPSHOT.js.map"
):
path_dict
[
"CLI_SNAPSHOT.js.map"
]
=
f
elif
f
.
endswith
(
"CLI_SNAPSHOT.bin"
):
path_dict
[
"CLI_SNAPSHOT.bin"
]
=
f
elif
f
.
endswith
(
"COMPILER_SNAPSHOT.js"
):
path_dict
[
"COMPILER_SNAPSHOT.js"
]
=
f
elif
f
.
endswith
(
"COMPILER_SNAPSHOT.js.map"
):
path_dict
[
"COMPILER_SNAPSHOT.js.map"
]
=
f
elif
f
.
endswith
(
"COMPILER_SNAPSHOT.bin"
):
path_dict
[
"COMPILER_SNAPSHOT.bin"
]
=
f
sizes
=
{}
for
name
,
path
in
path_dict
.
items
():
assert
os
.
path
.
exists
(
path
)
sizes
[
name
]
=
os
.
path
.
getsize
(
path
)
mtimes
=
{}
# The deno executable should be located at the root of the build tree.
deno_exe
=
os
.
path
.
join
(
build_dir
,
"deno"
+
executable_suffix
)
sizes
[
"deno"
]
=
os
.
path
.
getsize
(
deno_exe
)
# Because cargo's OUT_DIR is not predictable, search the build tree for
# snapshot related files.
for
parent_dir
,
_
,
file_names
in
os
.
walk
(
build_dir
):
for
file_name
in
file_names
:
if
not
file_name
in
[
"CLI_SNAPSHOT.bin"
,
"CLI_SNAPSHOT.js"
,
"CLI_SNAPSHOT.js.map"
,
"COMPILER_SNAPSHOT.bin"
,
"COMPILER_SNAPSHOT.js"
,
"COMPILER_SNAPSHOT.js.map"
,
]:
continue
file_path
=
os
.
path
.
join
(
parent_dir
,
file_name
)
file_mtime
=
os
.
path
.
getmtime
(
file_path
)
# If multiple copies of a file are found, use the most recent one.
if
file_name
in
mtimes
and
mtimes
[
file_name
]
>
file_mtime
:
continue
mtimes
[
file_name
]
=
file_mtime
sizes
[
file_name
]
=
os
.
path
.
getsize
(
file_path
)
return
sizes
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录