Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
a44cbeec
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,发现更多精彩内容 >>
提交
a44cbeec
编写于
12月 12, 2017
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - more timer migration
上级
16874c18
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
33 addition
and
30 deletion
+33
-30
src/vs/base/common/performance.d.ts
src/vs/base/common/performance.d.ts
+2
-0
src/vs/base/common/performance.js
src/vs/base/common/performance.js
+20
-0
src/vs/workbench/electron-browser/bootstrap/index.js
src/vs/workbench/electron-browser/bootstrap/index.js
+2
-2
src/vs/workbench/electron-browser/shell.ts
src/vs/workbench/electron-browser/shell.ts
+0
-2
src/vs/workbench/electron-browser/workbench.ts
src/vs/workbench/electron-browser/workbench.ts
+5
-15
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
+4
-8
未找到文件。
src/vs/base/common/performance.d.ts
浏览文件 @
a44cbeec
...
...
@@ -26,6 +26,8 @@ export function getEntries(type: 'mark' | 'measure'): PerformanceEntry[];
export
function
getEntry
(
type
:
'
mark
'
|
'
measure
'
,
name
:
string
):
PerformanceEntry
;
export
function
getDuration
(
from
:
string
,
to
:
string
):
number
;
type
ExportData
=
any
[];
export
function
importEntries
(
data
:
ExportData
):
void
;
export
function
exportEntries
():
ExportData
;
src/vs/base/common/performance.js
浏览文件 @
a44cbeec
...
...
@@ -67,6 +67,25 @@ define([], function () {
}
}
function
getDuration
(
from
,
to
)
{
const
entries
=
global
.
_performanceEntries
;
let
name
=
from
;
let
startTime
=
0
;
for
(
let
i
=
0
;
i
<
entries
.
length
;
i
+=
4
)
{
if
(
entries
[
i
+
1
]
===
name
)
{
if
(
name
===
from
)
{
// found `from` (start of interval)
name
=
to
;
startTime
=
entries
[
i
+
2
];
}
else
{
// from `to` (end of interval)
return
entries
[
i
+
2
]
-
startTime
;
}
}
}
return
0
;
}
function
mark
(
name
)
{
global
.
_performanceEntries
.
push
(
'
mark
'
,
name
,
_now
(),
0
);
if
(
typeof
console
.
timeStamp
===
'
function
'
)
{
...
...
@@ -118,6 +137,7 @@ define([], function () {
time
:
time
,
getEntries
:
getEntries
,
getEntry
:
getEntry
,
getDuration
:
getDuration
,
importEntries
:
importEntries
,
exportEntries
:
exportEntries
};
...
...
src/vs/workbench/electron-browser/bootstrap/index.js
浏览文件 @
a44cbeec
...
...
@@ -179,13 +179,13 @@ function main() {
windowLoad
:
configuration
.
perfWindowLoadTime
};
const
workbenchMainClock
=
perf
.
time
(
'
l
oadWorkbenchMain
'
);
perf
.
mark
(
'
willL
oadWorkbenchMain
'
);
require
([
'
vs/workbench/workbench.main
'
,
'
vs/nls!vs/workbench/workbench.main
'
,
'
vs/css!vs/workbench/workbench.main
'
],
function
()
{
workbenchMainClock
.
stop
(
);
perf
.
mark
(
'
didLoadWorkbenchMain
'
);
process
.
lazyEnv
.
then
(
function
()
{
perf
.
mark
(
'
main/startup
'
);
...
...
src/vs/workbench/electron-browser/shell.ts
浏览文件 @
a44cbeec
...
...
@@ -252,8 +252,6 @@ export class WorkbenchShell {
// Telemetry: startup metrics
this
.
timerService
.
workbenchStarted
=
Date
.
now
();
this
.
timerService
.
restoreEditorsDuration
=
info
.
restoreEditorsDuration
;
this
.
timerService
.
restoreViewletDuration
=
info
.
restoreViewletDuration
;
this
.
extensionService
.
whenInstalledExtensionsRegistered
().
done
(()
=>
{
/* __GDPR__
"startupTime" : {
...
...
src/vs/workbench/electron-browser/workbench.ts
浏览文件 @
a44cbeec
...
...
@@ -15,8 +15,7 @@ import DOM = require('vs/base/browser/dom');
import
{
Builder
,
$
}
from
'
vs/base/browser/builder
'
;
import
{
Delayer
,
RunOnceScheduler
}
from
'
vs/base/common/async
'
;
import
*
as
browser
from
'
vs/base/browser/browser
'
;
import
{
StopWatch
}
from
'
vs/base/common/stopwatch
'
;
import
{
time
}
from
'
vs/base/common/performance
'
;
import
*
as
perf
from
'
vs/base/common/performance
'
;
import
errors
=
require
(
'
vs/base/common/errors
'
);
import
{
BackupFileService
}
from
'
vs/workbench/services/backup/node/backupFileService
'
;
import
{
IBackupFileService
}
from
'
vs/workbench/services/backup/common/backup
'
;
...
...
@@ -120,8 +119,6 @@ interface IZenModeSettings {
export
interface
IWorkbenchStartedInfo
{
customKeybindingsCount
:
number
;
restoreViewletDuration
:
number
;
restoreEditorsDuration
:
number
;
pinnedViewlets
:
string
[];
restoredViewlet
:
string
;
restoredEditors
:
string
[];
...
...
@@ -319,8 +316,7 @@ export class Workbench implements IPartService {
const
restorePromises
:
TPromise
<
any
>
[]
=
[];
// Restore Editors
const
editorRestoreStopWatch
=
StopWatch
.
create
();
const
editorRestoreClock
=
time
(
'
restore:editors
'
);
perf
.
mark
(
'
willRestoreEditors
'
);
const
restoredEditors
:
string
[]
=
[];
restorePromises
.
push
(
this
.
resolveEditorsToOpen
().
then
(
inputs
=>
{
...
...
@@ -337,8 +333,7 @@ export class Workbench implements IPartService {
return
editorOpenPromise
.
then
(
editors
=>
{
this
.
handleEditorBackground
();
// make sure we show the proper background in the editor area
editorRestoreClock
.
stop
();
editorRestoreStopWatch
.
stop
();
perf
.
mark
(
'
didRestoreEditors
'
);
for
(
const
editor
of
editors
)
{
if
(
editor
)
{
...
...
@@ -353,7 +348,6 @@ export class Workbench implements IPartService {
}));
// Restore Sidebar
let
viewletRestoreStopWatch
:
StopWatch
;
let
viewletIdToRestore
:
string
;
if
(
!
this
.
sideBarHidden
)
{
this
.
sideBarVisibleContext
.
set
(
true
);
...
...
@@ -366,11 +360,9 @@ export class Workbench implements IPartService {
viewletIdToRestore
=
this
.
viewletService
.
getDefaultViewletId
();
}
viewletRestoreStopWatch
=
StopWatch
.
create
();
const
viewletRestoreClock
=
time
(
'
restore:viewlet
'
);
perf
.
mark
(
'
willRestoreViewlet
'
);
restorePromises
.
push
(
this
.
viewletService
.
openViewlet
(
viewletIdToRestore
).
then
(()
=>
{
viewletRestoreStopWatch
.
stop
();
viewletRestoreClock
.
stop
();
perf
.
mark
(
'
didRestoreViewlet
'
);
}));
}
...
...
@@ -395,8 +387,6 @@ export class Workbench implements IPartService {
return
{
customKeybindingsCount
:
this
.
keybindingService
.
customKeybindingsCount
(),
restoreViewletDuration
:
viewletRestoreStopWatch
?
Math
.
round
(
viewletRestoreStopWatch
.
elapsed
())
:
0
,
restoreEditorsDuration
:
Math
.
round
(
editorRestoreStopWatch
.
elapsed
()),
pinnedViewlets
:
this
.
activitybarPart
.
getPinned
(),
restoredViewlet
:
viewletIdToRestore
,
restoredEditors
...
...
src/vs/workbench/services/timer/common/timerService.ts
浏览文件 @
a44cbeec
...
...
@@ -104,8 +104,5 @@ export interface ITimerService extends IInitData {
beforeExtensionLoad
:
number
;
afterExtensionLoad
:
number
;
restoreViewletDuration
:
number
;
restoreEditorsDuration
:
number
;
readonly
startupMetrics
:
IStartupMetrics
;
}
src/vs/workbench/services/timer/node/timerService.ts
浏览文件 @
a44cbeec
...
...
@@ -29,10 +29,6 @@ export class TimerService implements ITimerService {
public
beforeExtensionLoad
:
number
;
public
afterExtensionLoad
:
number
;
public
restoreViewletDuration
:
number
;
public
restoreEditorsDuration
:
number
;
private
_startupMetrics
:
IStartupMetrics
;
constructor
(
initData
:
IInitData
,
private
isEmptyWorkbench
:
boolean
)
{
...
...
@@ -91,11 +87,11 @@ export class TimerService implements ITimerService {
timers
:
{
ellapsedExtensions
:
this
.
afterExtensionLoad
-
this
.
beforeExtensionLoad
,
ellapsedExtensionsReady
:
this
.
afterExtensionLoad
-
start
,
ellapsedRequire
:
perf
.
get
Entry
(
'
measure
'
,
'
loadWorkbenchMain
'
).
duration
,
ellapsed
ViewletRestore
:
this
.
restoreViewletDuration
,
ellapsed
EditorRestore
:
this
.
restoreEditorsDuration
,
ellapsedRequire
:
perf
.
get
Duration
(
'
willLoadWorkbenchMain
'
,
'
didLoadWorkbenchMain
'
)
,
ellapsed
EditorRestore
:
perf
.
getDuration
(
'
willRestoreEditors
'
,
'
didRestoreEditors
'
)
,
ellapsed
ViewletRestore
:
perf
.
getDuration
(
'
willRestoreViewlet
'
,
'
didRestoreViewlet
'
)
,
ellapsedWorkbench
:
this
.
workbenchStarted
-
this
.
beforeWorkbenchOpen
,
ellapsedWindowLoadToRequire
:
perf
.
getEntry
(
'
mark
'
,
'
loadWorkbenchMain/start
'
).
startTime
-
this
.
windowLoad
,
ellapsedWindowLoadToRequire
:
perf
.
getEntry
(
'
mark
'
,
'
willLoadWorkbenchMain
'
).
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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录