Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow startup / crashes - unusable #335

Closed
Morgy93 opened this issue Nov 20, 2015 · 27 comments
Closed

Slow startup / crashes - unusable #335

Morgy93 opened this issue Nov 20, 2015 · 27 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded

Comments

@Morgy93
Copy link

Morgy93 commented Nov 20, 2015

Hello,

since the release of VS Code v0.10.1 I cannot use it anymore - yes, I already tried to reinstall it.
It takes minutes to start and all I'm getting is the following:
unbenannt

I am using Windows 10 Pro on my Microsoft Surface Pro 3.

@tominon
Copy link

tominon commented Nov 20, 2015

Duplicate of #160

@Morgy93
Copy link
Author

Morgy93 commented Nov 20, 2015

@tominon I already went through that issue, but it's not that much of a duplicate. Everyone is having issues related to php and stuff, while I just try to open up the Editor via the code.exe / desktop icon.

@bpasero bpasero self-assigned this Nov 20, 2015
@bpasero
Copy link
Member

bpasero commented Nov 20, 2015

@Morgy93 can you run code.exe from the program files directory with the "--verbose" flag and attach the output you are seeing?

@Morgy93
Copy link
Author

Morgy93 commented Nov 20, 2015

@bpasero I hope I didn't get it wrong. This is what I put into the "Target:" property of the icon, but there is no extra output on startup.
unbenannt
Even if I go for View -> Toggle Output there's just "Output for 'Git'" with lots of empty space.

@bpasero
Copy link
Member

bpasero commented Nov 20, 2015

@Morgy93 sry, I meant to say that you try from the windows command prompt.

@Morgy93
Copy link
Author

Morgy93 commented Nov 20, 2015

@bpasero Alright, here we go:

### VSCode main.js ###
c:\Program Files (x86)\Microsoft VS Code\resources\app { pathArguments: [],
  programStart: 0,
  workers: -1,
  enablePerformance: false,
  verboseLogging: true,
  debugPluginHostPort: undefined,
  debugBrkPluginHost: undefined,
  logPluginHostCommunication: false,
  firstrun: false,
  openNewWindow: false,
  openInSameWindow: false,
  gotoLineMode: false,
  pluginHomePath: undefined,
  pluginDevelopmentPath: undefined,
  pluginTestsPath: undefined }
Lifecycle#unload() 1

Here it just takes forever for Code to start .. then the "crash" happens:

[VS Code]: detected unresponsive

unbenannt
And if I go for "Keep Waiting" or just do nothing, this gets added:

IPC#vscode-workbenchLoaded

And Code is ready for use now it seems .. after like two to three minutes of waiting.

For the easiness, full log:

C:\Users\Thomas>"C:\Program Files (x86)\Microsoft VS Code\code.exe" --verbose

C:\Users\Thomas>
### VSCode main.js ###
c:\Program Files (x86)\Microsoft VS Code\resources\app { pathArguments: [],
  programStart: 0,
  workers: -1,
  enablePerformance: false,
  verboseLogging: true,
  debugPluginHostPort: undefined,
  debugBrkPluginHost: undefined,
  logPluginHostCommunication: false,
  firstrun: false,
  openNewWindow: false,
  openInSameWindow: false,
  gotoLineMode: false,
  pluginHomePath: undefined,
  pluginDevelopmentPath: undefined,
  pluginTestsPath: undefined }
Lifecycle#unload() 1
[VS Code]: detected unresponsive
IPC#vscode-workbenchLoaded

@bpasero
Copy link
Member

bpasero commented Nov 21, 2015

@Morgy93 can you try starting code.exe -n (will open an empty workbench without folder) to see if it changes anything?

@Morgy93
Copy link
Author

Morgy93 commented Nov 21, 2015

@bpasero Well, it still took minutes to show up while using around 30% of my CPU, but at least I didn't get the "crash" message and were able to use it right away.

@bpasero
Copy link
Member

bpasero commented Nov 21, 2015

@Morgy93 any extensions installed? Otherwise I am totally clueless...

@Morgy93
Copy link
Author

Morgy93 commented Nov 21, 2015

@bpasero Nope, I just made the automatic update from my previous version to the v0.10.1 which immediately caused this issue. Like I said I already reinstalled it, but nothing changed. I also don't know what else to do. Anything else I could provide to resolve this issue?

@chrisdias chrisdias added the bug Issue identified by VS Code Team member as probable bug label Nov 21, 2015
@bpasero bpasero removed the bug Issue identified by VS Code Team member as probable bug label Nov 23, 2015
@bpasero
Copy link
Member

bpasero commented Nov 23, 2015

@Morgy93 maybe use process explorer to analyze which process within code.exe actually causes the slowness, we start with more then one process and it would be interesting if one of them is spiking and consuming most startup time.

@bpasero
Copy link
Member

bpasero commented Nov 23, 2015

Also can you try running "code.exe --disable-gpu" from a command prompt from the installation folder of code to see if it makes any difference?

@Morgy93
Copy link
Author

Morgy93 commented Nov 23, 2015

@bpasero Sadly --disable-gpu doesn't help.
Maybe here's something that helps? (Phew, a lot of parameters..)
vscode

I'll have a look at this process explorer thing in the meanwhile..

@bpasero
Copy link
Member

bpasero commented Nov 23, 2015

@Morgy93 yes please, there are processes within the one that is selected in your screen shot that could cause that one to take so long.

@Morgy93
Copy link
Author

Morgy93 commented Nov 23, 2015

@bpasero I took this one: https://technet.microsoft.com/de-de/sysinternals/processexplorer.aspx
But the output is most likely the same:

vscode2

"C:\Program Files (x86)\Microsoft VS Code\code.exe" --type=renderer --no-sandbox --lang=de --app-user-model-id=Microsoft.VisualStudioCode --node-integration=true --enable-pinch --device-scale-factor=1 --enable-delegated-renderer --num-raster-threads=2 --gpu-rasterization-msaa-sample-count=8 --content-image-texture-target=3553 --video-image-texture-target=3553 --channel="11656.1.1109162074\190479848" /prefetch:673131151

vscode3

Don't really know what's important for you within this tool, so please be a bit more precise. :)

@bpasero
Copy link
Member

bpasero commented Nov 23, 2015

@Morgy93 I am using process explorer and it allows to group processes hierarchically and then I can expand the renderer process of code.exe to see spawned children within:

image

Can you use the same tool and then see if any of the processes within the renderer is busy or actually really the renderer?

@Morgy93
Copy link
Author

Morgy93 commented Nov 23, 2015

@bpasero Actually that's just what I did, but there is no other process before the editor is fully loaded.
Have a look at the comparison:

I am starting VS Code and wait for the UI to load a bit (nothing changed till here):
screenshot- 21

Then suddenly I get the no response error message and still nothing changed:
screenshot- 22

Just after waiting for a little longer, the editor is fully loaded and two new processes spawned within the one which was consuming the cpu power.
screenshot- 23

That's pretty much everything that happens.
Maybe I provide Teamviewer access or something similar to you and you play around with it for yourself? I don't mind struggling around with it like that, but maybe that boosts the process of solving the problem. :)

@Morgy93
Copy link
Author

Morgy93 commented Nov 23, 2015

Just to let you know:
I just installed version 0.9.2 from this source https://az764295.vo.msecnd.net/public/0.9.2/VSCodeSetup.exe over my existing installation and VS Code started up fast again.
Now I installed the latest release from the official website over the 0.9.2 installation and .. see.. it's slow again.
So I assume that there are code changes between 0.9.2 and 0.10.1 which cause this issue.

@bpasero
Copy link
Member

bpasero commented Nov 24, 2015

@Morgy93 good insights, thanks. Especially good to know that 0.9.2 loads fast for you. There are two things that changed for the 0.10.x release: Lots of code changes on our end but also an update to the cross platform framework (Electron).

First of all we need to understand if this is caused by code changes or by Electron. The easiest to start with is to set you up to run Code from its sources so that we can tweak changes and rapidly see if it helps.

Can you follow https://github.com/Microsoft/vscode/wiki/How-to-Contribute#build-and-run-from-source and when you launch code see if you see the same issue of slow startup?

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug and removed bug Issue identified by VS Code Team member as probable bug labels Nov 24, 2015
@bpasero
Copy link
Member

bpasero commented Nov 26, 2015

@Morgy93 another thought I had was if - once VS Code is up and running - you could see if reloading the application is also slow. For that you can just trigger View | Command Palette | Reload Window.

If that action turns out to be as slow, we have a chance to run a profiler to see where the time is spent. For that - before reloading - run Help | Toggle Developer Tools, click Profiles, then press the Start button and run the reload action. After that, press the Stop button. You should get a list of function calls and their timings. You can export this report from the little "Save" button next to "Profile 1" on the left.

image

@Morgy93
Copy link
Author

Morgy93 commented Nov 26, 2015

By the way I just updated to version 0.10.2 but the issue remains. But from now on I will most likely rely on that version, if no other instructions are given.

@bpasero I'll try the build and run from source at the weekend. (If needed)
The Reload Window option is also slow, cpu consuming and causes the "does not respond" error message.
Here's the Profile dump:
EDIT: Removed because it may contained user data

And some picture:
vscode4

@bpasero
Copy link
Member

bpasero commented Nov 26, 2015

@Morgy93 thanks a lot for the profile, this helped identify the issue and in fact many more users are hit. This likely qualifies for an update that we will push out to all users but we need some verification first. So I have a couple of asks for you:

1.) can you download the following build of VS Code (standalone zip, no installer) and open Code.exe to see if performance is better. I uploaded the zip to my onedrive: http://1drv.ms/1NQvCOu

2.) if performance is better: close the instance and open \resources\app\out\vs\workbench\electron-browser\index.html in that zip and make the following console.log additions after this line:

process.env['VSCODE_SHARED_IPC_HOOK'] = configuration.sharedIPCHandle;

console.log('URL length: ' + window.document.URL.length);
console.log(JSON.stringify(configuration, null, '\t'));

Then save the file and run Code again from the zip and hit Help | Toggle Developer Tools. You should then see potentially lots of output from the log statements. I would need the entire log, since it may contain user data it should probably be not attached to this issue but you can send it via mail ([email protected]).

@Morgy93
Copy link
Author

Morgy93 commented Nov 26, 2015

@bpasero Performance is good again - log sent via mail.

@bpasero
Copy link
Member

bpasero commented Nov 26, 2015

To people hitting this issue: We might not be able to release a new version until next week. But there is a workaround:

If you can start Code eventually:

  • select File | Open Recent | Clear Items
  • restart and things should be fast again

If you cannot start Code:

Sorry for the trouble ❤️

@slayerxj
Copy link

slayerxj commented Dec 2, 2015

Hi, I can still reproduce the issue in version 0.10.3.
When I open a JSON file which size is about 4M, the VS code stops responding. It used to be OK before 0.10.1.

@bpasero
Copy link
Member

bpasero commented Dec 2, 2015

@slayerxj that seems like a different issue that should get filed, please do that!

@egamma egamma mentioned this issue Dec 3, 2015
34 tasks
@slayerxj
Copy link

slayerxj commented Dec 4, 2015

@bpasero Sorry, I thought they were same because the first time I met this issue, that JSON file was supposed to be shown at startup. So I did experience slow startup / crashes :) And now after reading the discussions I realized they're different.

@bpasero bpasero added the verified Verification succeeded label Dec 15, 2015
@egamma egamma mentioned this issue Jan 6, 2016
59 tasks
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants