microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.62k stars 28.67k forks source link

Startup performance issue window_load #121319

Closed Luiz-Monad closed 3 years ago

Luiz-Monad commented 3 years ago

System Info

Performance Marks

What Duration Process Info
start => app.isReady 83 [main] initial startup: true
nls:start => nls:end 0 [main] initial startup: true
require(main.bundle.js) 125 [main] initial startup: true
app.isReady => window.loadUrl() 368 [main] initial startup: true
window.loadUrl() => begin to require(workbench.desktop.main.js) 7099 [main->renderer] NewWindow
require(workbench.desktop.main.js) 849 [renderer] cached data: NO, node_modules took 0ms
wait for shell environment 0 [renderer] -
init storage (global & workspace) 53 [renderer] -
init workspace service 44 [renderer] -
register extensions & spawn extension host 352 [renderer] -
restore viewlet 0 [renderer] -
restore panel 0 [renderer] -
restore editors 128 [renderer] 1: PerfviewInput
overall workbench load 486 [renderer] -
workbench ready 8950 [main->renderer] -
renderer ready 1406 [renderer] -
shared process connection ready 0 [renderer->sharedprocess] -
extensions registered 9389 [renderer] -

Extension Activation Stats

Extension Eager Load Code Call Activate Finish Activate Event By
vscode.debug-auto-launch true 5 0 41 * vscode.debug-auto-launch
vscode.git true 87 7 63 * vscode.github
vscode.github true 9 0 0 * vscode.github
christian-kohler.path-intellisense true 41 0 34 * christian-kohler.path-intellisense
CoenraadS.bracket-pair-colorizer-2 true 42 24 10 * CoenraadS.bracket-pair-colorizer-2
donjayamanne.githistory true 80 10 0 * donjayamanne.githistory
EditorConfig.EditorConfig true 40 0 0 * EditorConfig.EditorConfig
vscode.emmet false 24 2 4 onStartupFinished vscode.emmet
vscode.extension-editing false 29 0 44 onLanguage:markdown vscode.extension-editing
vscode.github-authentication false 23 2 151 onAuthenticationRequest:github vscode.github-authentication
vscode.markdown-language-features false 78 3 41 onLanguage:markdown vscode.markdown-language-features
vscode.merge-conflict false 4 1 3 onStartupFinished vscode.merge-conflict
vscode.microsoft-authentication false 38 4 848 onAuthenticationRequest:microsoft vscode.microsoft-authentication
ms-vscode-remote.remote-wsl-recommender false 19 2 2 onStartupFinished ms-vscode-remote.remote-wsl-recommender
ms-vscode.js-debug false 203 7 0 onCommand:extension.js-debug.clearAutoAttachVariables ms-vscode.js-debug
vscode.testing-editor-contributions false 1 0 2 onStartupFinished vscode.testing-editor-contributions
eamodio.gitlens false 118 1 63 onStartupFinished eamodio.gitlens
ms-vscode-remote.remote-containers false 85 0 637 onStartupFinished ms-vscode-remote.remote-containers
ryu1kn.partial-diff false 98 0 7 onStartupFinished ryu1kn.partial-diff

Raw Perf Marks: main

Name    Timestamp   Delta   Total
code/timeOrigin 1618430351997   0   0
code/didStartMain   1618430352637   640 640
code/mainAppReady   1618430352720   83  723
code/willLoadMainBundle 1618430352720   0   723
code/fork/willLoadCode  1618430352739   19  742
code/registerFilesystem/file    1618430352841   102 844
code/didLoadMainBundle  1618430352845   4   848
code/willOpenNewWindow  1618430353088   243 1091

Raw Perf Marks: renderer

Name    Timestamp   Delta   Total
code/timeOrigin 1618430353086   0   0
code/didStartRenderer   1618430360181   7095    7095
code/willShowPartsSplash    1618430360182   1   7096
code/didShowPartsSplash 1618430360183   1   7097
code/willLoadWorkbenchMain  1618430360187   4   7101
code/willWaitForShellEnv    1618430361035   848 7949
code/didWaitForShellEnv 1618430361035   0   7949
code/didLoadWorkbenchMain   1618430361036   1   7950
code/registerFilesystem/file    1618430361041   5   7955
code/registerFilesystem/vscode-userdata 1618430361041   0   7955
code/willInitWorkspaceService   1618430361046   5   7960
code/willInitStorage    1618430361047   1   7961
code/didInitWorkspaceService    1618430361090   43  8004
code/didInitStorage 1618430361100   10  8014
code/willStartWorkbench 1618430361101   1   8015
code/LifecyclePhase/Ready   1618430361105   4   8019
code/registerFilesystem/trustedDomains  1618430361230   125 8144
code/willRestoreEditors 1618430361459   229 8373
code/didRestoreEditors  1618430361587   128 8501
code/LifecyclePhase/Restored    1618430361587   0   8501
code/didStartWorkbench  1618430361587   0   8501
code/didRemovePartsSplash   1618430361587   0   8501
code/willConnectSharedProcess   1618430361607   20  8521
code/willLoadExtensions 1618430361674   67  8588
code/willHandleExtensionPoints  1618430361828   154 8742
code/didHandleExtensionPoints   1618430362020   192 8934
code/didLoadExtensions  1618430362026   6   8940

Raw Perf Marks: localExtHost

Name    Timestamp   Delta   Total
code/timeOrigin 1618430363770   0   0
code/fork/start 1618430363985   215 215
code/fork/willLoadCode  1618430364016   31  246
code/extHost/willConnectToRenderer  1618430364351   335 581
code/extHost/didConnectToRenderer   1618430364352   1   582
code/extHost/didWaitForInitData 1618430364423   71  653
code/extHost/didCreateServices  1618430364435   12  665
code/extHost/willWaitForConfig  1618430364439   4   669
code/extHost/didWaitForConfig   1618430364486   47  716
code/extHost/didInitAPI 1618430364491   5   721
code/extHost/didInitProxyResolver   1618430364492   1   722
code/extHost/ready  1618430364492   0   722
code/extHost/willLoadExtensionCode/vscode.microsoft-authentication  1618430364520   28  750
code/extHost/didLoadExtensionCode/vscode.microsoft-authentication   1618430364558   38  788
code/extHost/willLoadExtensionCode/vscode.extension-editing 1618430364558   0   788
code/extHost/didLoadExtensionCode/vscode.extension-editing  1618430364587   29  817
code/extHost/willLoadExtensionCode/vscode.markdown-language-features    1618430364588   1   818
code/extHost/didLoadExtensionCode/vscode.markdown-language-features 1618430364666   78  896
code/extHost/willLoadExtensionCode/vscode.debug-auto-launch 1618430364666   0   896
code/extHost/didLoadExtensionCode/vscode.debug-auto-launch  1618430364671   5   901
code/extHost/willLoadExtensionCode/vscode.git   1618430364671   0   901
code/extHost/didLoadExtensionCode/vscode.git    1618430364758   87  988
code/extHost/willLoadExtensionCode/christian-kohler.path-intellisense   1618430364759   1   989
code/extHost/didLoadExtensionCode/christian-kohler.path-intellisense    1618430364800   41  1030
code/extHost/willLoadExtensionCode/CoenraadS.bracket-pair-colorizer-2   1618430364800   0   1030
code/extHost/didLoadExtensionCode/CoenraadS.bracket-pair-colorizer-2    1618430364842   42  1072
code/extHost/willLoadExtensionCode/donjayamanne.githistory  1618430364843   1   1073
code/extHost/didLoadExtensionCode/donjayamanne.githistory   1618430364923   80  1153
code/extHost/willLoadExtensionCode/EditorConfig.EditorConfig    1618430364923   0   1153
code/extHost/didLoadExtensionCode/EditorConfig.EditorConfig 1618430364963   40  1193
code/extHost/willActivateExtension/vscode.microsoft-authentication  1618430364971   8   1201
code/extHost/willActivateExtension/vscode.extension-editing 1618430364975   4   1205
code/extHost/willActivateExtension/vscode.markdown-language-features    1618430364975   0   1205
code/extHost/willActivateExtension/vscode.debug-auto-launch 1618430364978   3   1208
code/extHost/willActivateExtension/vscode.git   1618430364978   0   1208
code/extHost/willActivateExtension/christian-kohler.path-intellisense   1618430364985   7   1215
code/extHost/willActivateExtension/CoenraadS.bracket-pair-colorizer-2   1618430364985   0   1215
code/extHost/willActivateExtension/donjayamanne.githistory  1618430365009   24  1239
code/extHost/willActivateExtension/EditorConfig.EditorConfig    1618430365019   10  1249
code/extHost/didActivateExtension/vscode.extension-editing  1618430365019   0   1249
code/extHost/didActivateExtension/vscode.markdown-language-features 1618430365019   0   1249
code/extHost/didActivateExtension/vscode.debug-auto-launch  1618430365019   0   1249
code/extHost/didActivateExtension/christian-kohler.path-intellisense    1618430365019   0   1249
code/extHost/didActivateExtension/CoenraadS.bracket-pair-colorizer-2    1618430365019   0   1249
code/extHost/didActivateExtension/donjayamanne.githistory   1618430365019   0   1249
code/extHost/didActivateExtension/EditorConfig.EditorConfig 1618430365019   0   1249
code/extHost/didActivateExtension/vscode.git    1618430365048   29  1278
code/extHost/willLoadExtensionCode/vscode.github    1618430365802   754 2032
code/extHost/didLoadExtensionCode/vscode.github 1618430365811   9   2041
code/extHost/didActivateExtension/vscode.microsoft-authentication   1618430365825   14  2055
code/extHost/willActivateExtension/vscode.github    1618430365842   17  2072
code/extHost/didActivateExtension/vscode.github 1618430365842   0   2072

Node Cached Data Stats

cached data used

cached data missed

cached data rejected

cached data created (lazy, might need refreshes)

prof-bad1.renderer.cpuprofile.txt prof-bad1.extHost.cpuprofile.txt prof-bad1.main.cpuprofile.txt

vscodebot[bot] commented 3 years ago

(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

Luiz-Monad commented 3 years ago

Why does VsCode do so many things at startup serialized ?

image

I guess I should clear the jumplist cache or something, that's related to the last windows update.

Luiz-Monad commented 3 years ago

It seems to be some regression here https://github.com/microsoft/vscode/blob/c8af1d0c550b6e6a06e01d08bddc978949f65927/src/vs/code/electron-main/windows.ts#L1275 Wouldn't it be better to do that from the extensionHost ? This really don't need to be at startup, its just wasting time.

alexanderniebuhr commented 3 years ago

having the same issue lately. startup performance slowed over the last two releases or so

deepak1556 commented 3 years ago

Based on https://github.com/microsoft/vscode/issues/121377#issuecomment-838976898 the issue seems to be fixed with windows build 21376, @Luiz-Monad can you update and check. Thanks!

Luiz-Monad commented 3 years ago

Working !

It also fixed lots of other slow-downs in explorer.exe ! so yay

image