Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
4944cc28
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,体验更适合开发者的 AI 搜索 >>
提交
4944cc28
编写于
8月 13, 2018
作者:
J
Johannes Rieken
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
debt - remove last usages of globals and any-casts when it comes to perf marks
上级
1b5c9925
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
16 addition
and
36 deletion
+16
-36
src/main.js
src/main.js
+0
-3
src/vs/code/electron-main/window.ts
src/vs/code/electron-main/window.ts
+4
-6
src/vs/platform/windows/common/windows.ts
src/vs/platform/windows/common/windows.ts
+1
-4
src/vs/workbench/electron-browser/bootstrap/index.js
src/vs/workbench/electron-browser/bootstrap/index.js
+0
-8
src/vs/workbench/electron-browser/main.ts
src/vs/workbench/electron-browser/main.ts
+2
-2
src/vs/workbench/services/timer/electron-browser/timerService.ts
...workbench/services/timer/electron-browser/timerService.ts
+9
-13
未找到文件。
src/main.js
浏览文件 @
4944cc28
...
...
@@ -7,9 +7,6 @@
const
perf
=
require
(
'
./vs/base/common/performance
'
);
perf
.
mark
(
'
main:started
'
);
// Perf measurements
global
.
perfStartTime
=
Date
.
now
();
Error
.
stackTraceLimit
=
100
;
// increase number of stack frames (from 10, https://github.com/v8/v8/wiki/Stack-Trace-API)
const
fs
=
require
(
'
fs
'
);
...
...
src/vs/code/electron-main/window.ts
浏览文件 @
4944cc28
...
...
@@ -24,7 +24,7 @@ import { ICodeWindow, IWindowState, WindowMode } from 'vs/platform/windows/elect
import
{
IWorkspaceIdentifier
,
IWorkspacesMainService
}
from
'
vs/platform/workspaces/common/workspaces
'
;
import
{
IBackupMainService
}
from
'
vs/platform/backup/common/backup
'
;
import
{
ISerializableCommandAction
}
from
'
vs/platform/actions/common/actions
'
;
import
{
mark
,
exportEntries
}
from
'
vs/base/common/performance
'
;
import
*
as
perf
from
'
vs/base/common/performance
'
;
import
{
resolveMarketplaceHeaders
}
from
'
vs/platform/extensionManagement/node/extensionGalleryService
'
;
export
interface
IWindowCreationOptions
{
...
...
@@ -547,7 +547,7 @@ export class CodeWindow implements ICodeWindow {
}
// Load URL
mark
(
'
main:loadWindow
'
);
perf
.
mark
(
'
main:loadWindow
'
);
this
.
_win
.
loadURL
(
this
.
getUrl
(
configuration
));
// Make window visible if it did not open in N seconds because this indicates an error
...
...
@@ -621,10 +621,8 @@ export class CodeWindow implements ICodeWindow {
windowConfiguration
.
maximized
=
this
.
_win
.
isMaximized
();
windowConfiguration
.
frameless
=
this
.
hasHiddenTitleBarStyle
()
&&
!
isMacintosh
;
// Perf Counters
windowConfiguration
.
perfEntries
=
exportEntries
();
windowConfiguration
.
perfStartTime
=
(
<
any
>
global
).
perfStartTime
;
windowConfiguration
.
perfWindowLoadTime
=
Date
.
now
();
// Dump Perf Counters
windowConfiguration
.
perfEntries
=
perf
.
exportEntries
();
// Config (combination of process.argv and window configuration)
const
environment
=
parseArgs
(
process
.
argv
);
...
...
src/vs/platform/windows/common/windows.ts
浏览文件 @
4944cc28
...
...
@@ -346,9 +346,6 @@ export interface IWindowConfiguration extends ParsedArgs, IOpenFileRequest {
accessibilitySupport
?:
boolean
;
perfEntries
:
PerformanceEntry
[];
perfStartTime
?:
number
;
perfAppReady
?:
number
;
perfWindowLoadTime
?:
number
;
}
export
interface
IRunActionInWindowRequest
{
...
...
@@ -389,4 +386,4 @@ export class ActiveWindowManager implements IDisposable {
dispose
()
{
this
.
disposables
=
dispose
(
this
.
disposables
);
}
}
\ No newline at end of file
}
src/vs/workbench/electron-browser/bootstrap/index.js
浏览文件 @
4944cc28
...
...
@@ -306,14 +306,6 @@ function main() {
});
}
// Perf Counters
window
.
MonacoEnvironment
.
timers
=
{
isInitialStartup
:
!!
configuration
.
isInitialStartup
,
hasAccessibilitySupport
:
!!
configuration
.
accessibilitySupport
,
start
:
configuration
.
perfStartTime
,
windowLoad
:
configuration
.
perfWindowLoadTime
};
perf
.
mark
(
'
willLoadWorkbenchMain
'
);
require
([
'
vs/workbench/workbench.main
'
,
...
...
src/vs/workbench/electron-browser/main.ts
浏览文件 @
4944cc28
...
...
@@ -24,7 +24,7 @@ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceColle
import
{
realpath
}
from
'
vs/base/node/pfs
'
;
import
{
EnvironmentService
}
from
'
vs/platform/environment/node/environmentService
'
;
import
*
as
gracefulFs
from
'
graceful-fs
'
;
import
{
TimerService
,
IInitData
}
from
'
vs/workbench/services/timer/node
/timerService
'
;
import
{
TimerService
}
from
'
vs/workbench/services/timer/electron-browser
/timerService
'
;
import
{
KeyboardMapperFactory
}
from
'
vs/workbench/services/keybinding/electron-browser/keybindingService
'
;
import
{
IWindowConfiguration
,
IWindowsService
}
from
'
vs/platform/windows/common/windows
'
;
import
{
WindowsChannelClient
}
from
'
vs/platform/windows/common/windowsIpc
'
;
...
...
@@ -85,7 +85,7 @@ function openWorkbench(configuration: IWindowConfiguration): TPromise<void> {
// Since the configuration service is one of the core services that is used in so many places, we initialize it
// right before startup of the workbench shell to have its data ready for consumers
return
createAndInitializeWorkspaceService
(
configuration
,
environmentService
).
then
(
workspaceService
=>
{
const
timerService
=
new
TimerService
(
(
<
any
>
window
).
MonacoEnvironment
.
timers
as
IInitData
,
workspaceService
.
getWorkbenchState
()
===
WorkbenchState
.
EMPTY
);
const
timerService
=
new
TimerService
(
configuration
,
workspaceService
.
getWorkbenchState
()
===
WorkbenchState
.
EMPTY
);
const
storageService
=
createStorageService
(
workspaceService
,
environmentService
);
return
domContentLoaded
().
then
(()
=>
{
...
...
src/vs/workbench/services/timer/
node
/timerService.ts
→
src/vs/workbench/services/timer/
electron-browser
/timerService.ts
浏览文件 @
4944cc28
...
...
@@ -8,13 +8,9 @@ import { ITimerService, IStartupMetrics, IMemoryInfo } from 'vs/workbench/servic
import
{
virtualMachineHint
}
from
'
vs/base/node/id
'
;
import
*
as
perf
from
'
vs/base/common/performance
'
;
import
*
as
os
from
'
os
'
;
export
interface
IInitData
{
start
:
number
;
windowLoad
:
number
;
isInitialStartup
:
boolean
;
hasAccessibilitySupport
:
boolean
;
}
import
{
getAccessibilitySupport
}
from
'
vs/base/browser/browser
'
;
import
{
AccessibilitySupport
}
from
'
vs/base/common/platform
'
;
import
{
IWindowConfiguration
}
from
'
vs/platform/windows/common/windows
'
;
export
class
TimerService
implements
ITimerService
{
...
...
@@ -23,7 +19,7 @@ export class TimerService implements ITimerService {
private
_startupMetrics
:
IStartupMetrics
;
constructor
(
private
readonly
_
initData
:
IInitData
,
private
readonly
_
configuration
:
IWindowConfiguration
,
private
readonly
_isEmptyWorkbench
:
boolean
)
{
//
...
...
@@ -38,8 +34,8 @@ export class TimerService implements ITimerService {
public
_computeStartupMetrics
():
void
{
const
now
=
Date
.
now
();
const
initialStartup
=
!!
this
.
_
initData
.
isInitialStartup
;
const
start
=
initialStartup
?
this
.
_initData
.
start
:
this
.
_initData
.
windowLoad
;
const
initialStartup
=
!!
this
.
_
configuration
.
isInitialStartup
;
const
start
Mark
=
initialStartup
?
'
main:started
'
:
'
main:loadWindow
'
;
let
totalmem
:
number
;
let
freemem
:
number
;
...
...
@@ -72,7 +68,7 @@ export class TimerService implements ITimerService {
this
.
_startupMetrics
=
{
version
:
1
,
ellapsed
:
perf
.
get
Entry
(
'
mark
'
,
'
didStartWorkbench
'
).
startTime
-
start
,
ellapsed
:
perf
.
get
Duration
(
startMark
,
'
didStartWorkbench
'
)
,
timers
:
{
ellapsedAppReady
:
initialStartup
?
perf
.
getDuration
(
'
main:started
'
,
'
main:appReady
'
)
:
undefined
,
ellapsedNlsGeneration
:
perf
.
getDuration
(
'
nlsGeneration:start
'
,
'
nlsGeneration:end
'
),
...
...
@@ -83,7 +79,7 @@ export class TimerService implements ITimerService {
ellapsedEditorRestore
:
perf
.
getDuration
(
'
willRestoreEditors
'
,
'
didRestoreEditors
'
),
ellapsedViewletRestore
:
perf
.
getDuration
(
'
willRestoreViewlet
'
,
'
didRestoreViewlet
'
),
ellapsedWorkbench
:
perf
.
getDuration
(
'
willStartWorkbench
'
,
'
didStartWorkbench
'
),
ellapsedExtensionsReady
:
perf
.
get
Entry
(
'
mark
'
,
'
didLoadExtensions
'
).
startTime
-
start
,
ellapsedExtensionsReady
:
perf
.
get
Duration
(
startMark
,
'
didLoadExtensions
'
)
,
ellapsedTimersToTimersComputed
:
Date
.
now
()
-
now
,
},
platform
,
...
...
@@ -96,7 +92,7 @@ export class TimerService implements ITimerService {
loadavg
,
initialStartup
,
isVMLikelyhood
,
hasAccessibilitySupport
:
!!
this
.
_initData
.
hasAccessibilitySupport
,
hasAccessibilitySupport
:
getAccessibilitySupport
()
===
AccessibilitySupport
.
Enabled
,
emptyWorkbench
:
this
.
_isEmptyWorkbench
};
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录