Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
e7ea0aba
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e7ea0aba
编写于
8月 16, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove any-casts, wait for extensions to be ready
上级
a17c20fb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
22 addition
and
17 deletion
+22
-17
src/vs/workbench/electron-browser/actions.ts
src/vs/workbench/electron-browser/actions.ts
+22
-17
未找到文件。
src/vs/workbench/electron-browser/actions.ts
浏览文件 @
e7ea0aba
...
...
@@ -52,6 +52,7 @@ import { IModelService } from 'vs/editor/common/services/modelService';
import
{
IModeService
}
from
'
vs/editor/common/services/modeService
'
;
import
{
IQuickInputService
,
IQuickPickItem
,
IQuickInputButton
,
IQuickPickSeparator
,
IKeyMods
}
from
'
vs/platform/quickinput/common/quickInput
'
;
import
{
getIconClasses
}
from
'
vs/workbench/browser/labels
'
;
import
{
timeout
}
from
'
vs/base/common/async
'
;
// --- actions
...
...
@@ -304,15 +305,19 @@ export class ShowStartupPerformance extends Action {
super
(
id
,
label
);
}
run
():
TPromise
<
boolean
>
{
async
run
():
TPromise
<
boolean
>
{
// Show dev tools
this
.
windowService
.
openDevTools
();
// Print to console
setTimeout
(()
=>
{
(
<
any
>
console
).
group
(
'
Startup Performance Measurement
'
);
Promise
.
all
([
timeout
(
1000
),
// needed to print a table
this
.
extensionService
.
whenInstalledExtensionsRegistered
()
]).
then
(()
=>
{
const
metrics
:
IStartupMetrics
=
this
.
timerService
.
startupMetrics
;
console
.
group
(
'
Startup Performance Measurement
'
);
console
.
log
(
`OS:
${
metrics
.
platform
}
(
${
metrics
.
release
}
)`
);
console
.
log
(
`CPUs:
${
metrics
.
cpus
.
model
}
(
${
metrics
.
cpus
.
count
}
x
${
metrics
.
cpus
.
speed
}
)`
);
console
.
log
(
`Memory (System):
${(
metrics
.
totalmem
/
(
1024
*
1024
*
1024
)).
toFixed
(
2
)}
GB (
${(
metrics
.
freemem
/
(
1024
*
1024
*
1024
)).
toFixed
(
2
)}
GB free)`
);
...
...
@@ -328,20 +333,20 @@ export class ShowStartupPerformance extends Action {
nodeModuleLoadTime
=
nodeModuleTimes
.
duration
;
}
(
<
any
>
console
)
.
table
(
this
.
getStartupMetricsTable
(
nodeModuleLoadTime
));
console
.
table
(
this
.
getStartupMetricsTable
(
nodeModuleLoadTime
));
if
(
this
.
environmentService
.
performance
)
{
const
data
=
this
.
analyzeLoaderStats
();
for
(
let
type
in
data
)
{
(
<
any
>
console
)
.
groupCollapsed
(
`Loader:
${
type
}
`
);
(
<
any
>
console
)
.
table
(
data
[
type
]);
(
<
any
>
console
)
.
groupEnd
();
console
.
groupCollapsed
(
`Loader:
${
type
}
`
);
console
.
table
(
data
[
type
]);
console
.
groupEnd
();
}
}
(
<
any
>
console
)
.
groupEnd
();
console
.
groupEnd
();
(
<
any
>
console
)
.
group
(
'
Extension Activation Stats
'
);
console
.
group
(
'
Extension Activation Stats
'
);
let
extensionsActivationTimes
:
{
[
id
:
string
]:
ActivationTimes
;
}
=
{};
let
extensionsStatus
=
this
.
extensionService
.
getExtensionsStatus
();
for
(
let
id
in
extensionsStatus
)
{
...
...
@@ -350,18 +355,18 @@ export class ShowStartupPerformance extends Action {
extensionsActivationTimes
[
id
]
=
status
.
activationTimes
;
}
}
(
<
any
>
console
)
.
table
(
extensionsActivationTimes
);
(
<
any
>
console
)
.
groupEnd
();
console
.
table
(
extensionsActivationTimes
);
console
.
groupEnd
();
(
<
any
>
console
)
.
group
(
'
Raw Startup Timers (CSV)
'
);
console
.
group
(
'
Raw Startup Timers (CSV)
'
);
let
value
=
`Name\tStart\n`
;
let
entries
=
getEntries
(
'
mark
'
);
for
(
const
entry
of
entries
)
{
value
+=
`
${
entry
.
name
}
\t
${
entry
.
startTime
}
\n`
;
}
console
.
log
(
value
);
(
<
any
>
console
)
.
groupEnd
();
}
,
1000
);
console
.
groupEnd
();
});
return
TPromise
.
as
(
true
);
}
...
...
@@ -376,14 +381,14 @@ export class ShowStartupPerformance extends Action {
table
.
push
({
Topic
:
'
[main] app.isReady => window.loadUrl()
'
,
'
Took (ms)
'
:
metrics
.
timers
.
ellapsedWindowLoad
});
}
table
.
push
({
Topic
:
'
[renderer] window.loadUrl() => begin to require(workbench.main.js)
'
,
'
Took (ms)
'
:
metrics
.
timers
.
ellapsedWindowLoadToRequire
});
table
.
push
({
Topic
:
'
[
main->
renderer] window.loadUrl() => begin to require(workbench.main.js)
'
,
'
Took (ms)
'
:
metrics
.
timers
.
ellapsedWindowLoadToRequire
});
table
.
push
({
Topic
:
'
[renderer] require(workbench.main.js)
'
,
'
Took (ms)
'
:
metrics
.
timers
.
ellapsedRequire
});
if
(
nodeModuleLoadTime
)
{
table
.
push
({
Topic
:
'
[renderer] -> of which require() node_modules
'
,
'
Took (ms)
'
:
nodeModuleLoadTime
});
}
table
.
push
({
Topic
:
'
[renderer]
create extension host => extensions onReady()
'
,
'
Took (ms)
'
:
metrics
.
timers
.
ellapsedExtensions
});
table
.
push
({
Topic
:
'
[renderer]
register extensions & spawn extension host
'
,
'
Took (ms)
'
:
metrics
.
timers
.
ellapsedExtensions
});
table
.
push
({
Topic
:
'
[renderer] restore viewlet
'
,
'
Took (ms)
'
:
metrics
.
timers
.
ellapsedViewletRestore
});
table
.
push
({
Topic
:
'
[renderer] restore editor view state
'
,
'
Took (ms)
'
:
metrics
.
timers
.
ellapsedEditorRestore
});
table
.
push
({
Topic
:
'
[renderer] overall workbench load
'
,
'
Took (ms)
'
:
metrics
.
timers
.
ellapsedWorkbench
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录