Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
16874c18
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,发现更多精彩内容 >>
提交
16874c18
编写于
12月 12, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - remove before/afterLoadWorkbenchMain, those are already perf-entries
上级
d0fef122
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
25 addition
and
19 deletion
+25
-19
src/vs/base/common/performance.d.ts
src/vs/base/common/performance.d.ts
+3
-1
src/vs/base/common/performance.js
src/vs/base/common/performance.js
+17
-2
src/vs/workbench/electron-browser/bootstrap/index.js
src/vs/workbench/electron-browser/bootstrap/index.js
+2
-4
src/vs/workbench/services/timer/common/timerService.ts
src/vs/workbench/services/timer/common/timerService.ts
+0
-3
src/vs/workbench/services/timer/node/timerService.ts
src/vs/workbench/services/timer/node/timerService.ts
+3
-9
未找到文件。
src/vs/base/common/performance.d.ts
浏览文件 @
16874c18
...
...
@@ -11,7 +11,8 @@ export interface PerformanceEntry {
}
export
function
mark
(
name
:
string
):
void
;
export
function
measure
(
name
:
string
,
from
?:
string
,
to
?:
string
):
void
;
export
function
measure
(
name
:
string
,
from
?:
string
,
to
?:
string
):
PerformanceEntry
;
/**
* Time something, shorthant for `mark` and `measure`
...
...
@@ -23,6 +24,7 @@ export function time(name: string): { stop(): void };
*/
export
function
getEntries
(
type
:
'
mark
'
|
'
measure
'
):
PerformanceEntry
[];
export
function
getEntry
(
type
:
'
mark
'
|
'
measure
'
,
name
:
string
):
PerformanceEntry
;
type
ExportData
=
any
[];
export
function
importEntries
(
data
:
ExportData
):
void
;
...
...
src/vs/base/common/performance.js
浏览文件 @
16874c18
...
...
@@ -34,11 +34,11 @@ define([], function () {
return
global
.
_performanceEntries
.
splice
(
0
);
}
function
getEntries
(
type
)
{
function
getEntries
(
type
,
name
)
{
const
result
=
[];
const
entries
=
global
.
_performanceEntries
;
for
(
let
i
=
0
;
i
<
entries
.
length
;
i
+=
4
)
{
if
(
entries
[
i
]
===
type
)
{
if
(
entries
[
i
]
===
type
&&
(
name
===
void
0
||
entries
[
i
+
1
]
===
name
)
)
{
result
.
push
({
type
:
entries
[
i
],
name
:
entries
[
i
+
1
],
...
...
@@ -53,6 +53,20 @@ define([], function () {
});
}
function
getEntry
(
type
,
name
)
{
const
entries
=
global
.
_performanceEntries
;
for
(
let
i
=
0
;
i
<
entries
.
length
;
i
+=
4
)
{
if
(
entries
[
i
]
===
type
&&
entries
[
i
+
1
]
===
name
)
{
return
{
type
:
entries
[
i
],
name
:
entries
[
i
+
1
],
startTime
:
entries
[
i
+
2
],
duration
:
entries
[
i
+
3
],
};
}
}
}
function
mark
(
name
)
{
global
.
_performanceEntries
.
push
(
'
mark
'
,
name
,
_now
(),
0
);
if
(
typeof
console
.
timeStamp
===
'
function
'
)
{
...
...
@@ -103,6 +117,7 @@ define([], function () {
measure
:
measure
,
time
:
time
,
getEntries
:
getEntries
,
getEntry
:
getEntry
,
importEntries
:
importEntries
,
exportEntries
:
exportEntries
};
...
...
src/vs/workbench/electron-browser/bootstrap/index.js
浏览文件 @
16874c18
...
...
@@ -171,13 +171,12 @@ function main() {
}
// Perf Counters
const
timers
=
window
.
MonacoEnvironment
.
timers
=
{
window
.
MonacoEnvironment
.
timers
=
{
isInitialStartup
:
!!
configuration
.
isInitialStartup
,
hasAccessibilitySupport
:
!!
configuration
.
accessibilitySupport
,
start
:
configuration
.
perfStartTime
,
appReady
:
configuration
.
perfAppReady
,
windowLoad
:
configuration
.
perfWindowLoadTime
,
beforeLoadWorkbenchMain
:
Date
.
now
()
windowLoad
:
configuration
.
perfWindowLoadTime
};
const
workbenchMainClock
=
perf
.
time
(
'
loadWorkbenchMain
'
);
...
...
@@ -187,7 +186,6 @@ function main() {
'
vs/css!vs/workbench/workbench.main
'
],
function
()
{
workbenchMainClock
.
stop
();
timers
.
afterLoadWorkbenchMain
=
Date
.
now
();
process
.
lazyEnv
.
then
(
function
()
{
perf
.
mark
(
'
main/startup
'
);
...
...
src/vs/workbench/services/timer/common/timerService.ts
浏览文件 @
16874c18
...
...
@@ -88,9 +88,6 @@ export interface IInitData {
windowLoad
:
number
;
beforeLoadWorkbenchMain
:
number
;
afterLoadWorkbenchMain
:
number
;
isInitialStartup
:
boolean
;
hasAccessibilitySupport
:
boolean
;
}
...
...
src/vs/workbench/services/timer/node/timerService.ts
浏览文件 @
16874c18
...
...
@@ -6,7 +6,7 @@
import
{
ITimerService
,
IStartupMetrics
,
IInitData
,
IMemoryInfo
}
from
'
vs/workbench/services/timer/common/timerService
'
;
import
{
virtualMachineHint
}
from
'
vs/base/node/id
'
;
import
*
as
perf
from
'
vs/base/common/performance
'
;
import
*
as
os
from
'
os
'
;
export
class
TimerService
implements
ITimerService
{
...
...
@@ -17,9 +17,6 @@ export class TimerService implements ITimerService {
public
readonly
appReady
:
number
;
public
readonly
windowLoad
:
number
;
public
readonly
beforeLoadWorkbenchMain
:
number
;
public
readonly
afterLoadWorkbenchMain
:
number
;
public
readonly
isInitialStartup
:
boolean
;
public
readonly
hasAccessibilitySupport
:
boolean
;
...
...
@@ -43,9 +40,6 @@ export class TimerService implements ITimerService {
this
.
appReady
=
initData
.
appReady
;
this
.
windowLoad
=
initData
.
windowLoad
;
this
.
beforeLoadWorkbenchMain
=
initData
.
beforeLoadWorkbenchMain
;
this
.
afterLoadWorkbenchMain
=
initData
.
afterLoadWorkbenchMain
;
this
.
isInitialStartup
=
initData
.
isInitialStartup
;
this
.
hasAccessibilitySupport
=
initData
.
hasAccessibilitySupport
;
}
...
...
@@ -97,11 +91,11 @@ export class TimerService implements ITimerService {
timers
:
{
ellapsedExtensions
:
this
.
afterExtensionLoad
-
this
.
beforeExtensionLoad
,
ellapsedExtensionsReady
:
this
.
afterExtensionLoad
-
start
,
ellapsedRequire
:
this
.
afterLoadWorkbenchMain
-
this
.
beforeLoadWorkbenchMai
n
,
ellapsedRequire
:
perf
.
getEntry
(
'
measure
'
,
'
loadWorkbenchMain
'
).
duratio
n
,
ellapsedViewletRestore
:
this
.
restoreViewletDuration
,
ellapsedEditorRestore
:
this
.
restoreEditorsDuration
,
ellapsedWorkbench
:
this
.
workbenchStarted
-
this
.
beforeWorkbenchOpen
,
ellapsedWindowLoadToRequire
:
this
.
beforeLoadWorkbenchMain
-
this
.
windowLoad
,
ellapsedWindowLoadToRequire
:
perf
.
getEntry
(
'
mark
'
,
'
loadWorkbenchMain/start
'
).
startTime
-
this
.
windowLoad
,
ellapsedTimersToTimersComputed
:
Date
.
now
()
-
now
},
platform
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录