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

Very slow startup time on Windows 7 64 bit for electron version 2.0.0 #12895

Closed
dough654 opened this issue May 11, 2018 · 40 comments
Closed

Very slow startup time on Windows 7 64 bit for electron version 2.0.0 #12895

dough654 opened this issue May 11, 2018 · 40 comments

Comments

@dough654
Copy link

  • Electron Version: 2.0.0
  • Operating System (Platform and Version): Windows 7 Enterprise 64 bit
  • Last known working Electron version: 1.8.6

I'm currently running windows 7 and tried to upgrade an electron app to version 2.0.0. It now takes ~1 minute for the application to finish loading before it becomes responsive. The same application running on electron 1.8.6 opens in ~1 second. I've replicated this with the base demo app as well.

I'm currently running node version 8.9.1 on the machine under node version manager.

I am starting the application using the following NPM command:

"start": ".\\node_modules\\electron\\dist\\electron.exe main.js --enable-logging",

The same behavior happens after packaging as well using electron-packager

I will continue to use 1.8.6 for now. Just wanted to bring this to your attention.

@welcome
Copy link

welcome bot commented May 11, 2018

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

To help make it easier for us to investigate your issue, please follow the contributing guidelines.

@bpasero
Copy link
Contributor

bpasero commented May 14, 2018

@dough654 is this windows running in a VM? Is this a single-CPU environment?

@baconbrad
Copy link
Contributor

I cannot replicate this. We have Electron 2.0.0 running in production in our company. We have quite a few Windows 7 machines running in our network and none of them are having this issue.

Do you have the same results with a fresh project?

@sofianguy sofianguy removed the blocked/need-info ❌ Cannot proceed without more information label Jun 19, 2018
@dough654
Copy link
Author

Sorry for the delayed response. I haven't had time to look in to it further, as I just reverted back to a previous version to get some work done.

Now however, we have another problem on our site. We use VSCode for our editor of choice, and since their recent release of version 1.26.0, that application has had the same slow-to-open issue. It's about 25 seconds before a window even shows up, and about 45 seconds before anything is functional. Previous to this version, vs code would be open and operational in about 2-3 seconds.

Checking the release notes of VSCode v1.26.0, sure enough, they upgraded the version of electron they were using.

I've been able to replicate this on a few other machines at the site, everyone appears to be having the same issue.

Our machines are relatively powerful, all running on SSDs i7 Quad Core with 32GB RAM. We're not running anything in a VM, it's all native.

Clearly there is something specific to our environment that is causing the slow down, since I doubt VSCode would ship with that type of slow performance on a major version of Windows.

Any ideas on how I can debug the issue and identify the root cause?

@bpasero
Copy link
Contributor

bpasero commented Aug 17, 2018

@dough654 VSCode has a wiki to diagnose slow startup issues: https://github.com/Microsoft/vscode/wiki/Performance-Issues

@dough654
Copy link
Author

Thanks, I'll give that a shot. Although it's pretty clear that the combination of 2.X version of electron and something in our environment is causing the issue, since we never had performance problems before with VSCode or any custom electron apps using 1.X versions.

Hopefully VSCode's diagnostics might shed some light. I'll respond back later with any results we find.

@dough654
Copy link
Author

So I did the diagnostics you recommended with VSCode, and this is what I got.

vscode-startup-slow

After that, I created a new app using electron-quick-start, and I tried commenting out the mainWindow.loadFile('index.html') line to see if it was maybe a chrome rendering thing, but it did not help. I then put a console.log message at the top of the main.js file and sure enough it still takes about 20 seconds before the log message shows up.

Whatever our problem is, it appears to be related to something in the electron.exe (happens before the node code gets initiated). I took a look in the task manager as I ran 'npm start', and I've noticed that the initial electron.exe gets spawned pretty much right away. But the second electron.exe process takes the 20 seconds to show up.

We've tried disabling our AV product, with no avail. I'm planning on testing on a windows 10 build soon to see if the issue persists there or not.

Any guidance or suggestions would be appreciated as we continue to troubleshoot.

@bpasero
Copy link
Contributor

bpasero commented Aug 20, 2018

@dough654 you could try to measure how long it takes until you get the app.on("ready") event. We have seen in the past that quite a bit of time can be spent until the app is even getting a signal to start building things.

@dough654
Copy link
Author

Thanks for the suggestion, but it still takes about 20+ seconds. I put a console.log statement at the very top of the main.js before and that also takes 20+seconds. So clearly the main.js is not even being interpreted until that point. Once the main.js does get initiated though, it takes another 20 or so seconds for the BrowserWindow to finish opening. Once it finishes opening, the render of the html file is instant. Maybe it's having trouble spawning new processes?

It's got to be something in electron.exe that's changed since previous versions that's now incompatible with our environment somehow. Maybe something in libuv?

@jrieken
Copy link

jrieken commented Aug 29, 2018

btw -
microsoft/vscode#56644 (comment) shows that folks with Windows 10 see this too, so it's not just Windows 7

@dough654
Copy link
Author

Just following up on this. As @jrieken referenced above, a good number of people are chiming in about VSCode, all with identical startup performance issues. Seems like the issue may be wider spread than I originally thought.

It's pretty clear that the update to electron 2.X is the culprit. Just wanted to bring the scope of this to the electron team's attention, so it can be prioritized appropriately.

Again, I'd be more than happy to run any diagnostics or tests in my environment to track down the issue.

@deepak1556
Copy link
Member

@dough654 can you provide the following details to eliminate some possible causes and further diagnose the issue.

  • Do you see the issue when you run the app with --no-proxy-resolver
  • If you have proxy auto detect settings can you try disabling it and run the app
  • Can you provide the output of --log-net-log for the app, app.exe --log-net-log=netlog.json
  • Do you have any problems with loading pages on the system with chrome 61.0.3163.79

@sofianguy sofianguy added the blocked/need-info ❌ Cannot proceed without more information label Sep 12, 2018
@sofianguy
Copy link
Contributor

@dough654 are you able to provide the information in the above comment?

@popfalushi
Copy link

btw: there are many logs in similar issue in VSCode bugtracker with all the logs: microsoft/vscode#56644

@popfalushi
Copy link

Does issue still requires more information to be solved or current info is sufficient? If more info is needed I'll be glad to provide - just tell me what.

@sxmpasch
Copy link

sxmpasch commented Oct 2, 2018

@deepak1556 :

Do you see the issue when you run the app with --no-proxy-resolver
YES
If you have proxy auto detect settings can you try disabling it and run the app
DISABLED, PROBLEM STILL EXISTS

If I look at the procmon.exe output (sysinternals tool), electron.exe is creating 3 threads. Between Thread Create #3 and any other activity, there are EXACTLY 20 seconds. For me, this looks like a timeout (thread acknowledge / semaphore / whatever). The activities before / after this timeout seem to have something to do with Winsock.
Could you please look at what you changed recently between 2.x and 3.x versions in that area? Do you see a semaphore timeout of 20s somewhere?

@popfalushi
Copy link

@sxmpasch
Actually, this is really nice idea. Searched repo, found one 20 sec timeout:

int timeout_in_milliseconds = 20 * 1000;

@sxmpasch
Copy link

sxmpasch commented Oct 2, 2018

@popfalushi
I tried out the electron base from bpasero's comment here. Without modifying main.js, I get the 20s timeout TWO times. One until the window opens, one until the index.html file is shown.
It looks like something is hanging until the function AttemptToNotifyRunningChrome() has returned.
So it seems we have to look at the call tree...

@deepak1556
Copy link
Member

@sxmpasch @popfalushi thanks for the additional info, I believe you were able to verify this issue with base electron app, can you confirm if this is present with 3.0 stable and 4.0.0-nightly.20180929 versions ? I was unable to verify this issue on my machine, so couldn't get much into debugging. Anything particular with respect to the network environments or machine setup that I should be aware of ? Thanks!

@maciejw
Copy link

maciejw commented Oct 2, 2018

@popfalushi on my two computers in corporate domain, laptop and workstation, both windows 10, I have the issue and the other people in my domain have the same thing, tens of people downgraded to vs code 1.25 with 1.7 version of electron. Maybe this is some kind of domain policy that causes this issue? we have also enterprise version of chrome installed, but on its own it works fine.

small update @deepak1556, I've used electron 4.0 you said and added it to quickstart and process started in instantly, on the same laptop, electron 3.0 has the performance issue.

electron 4.0 works fine so good news.

@sxmpasch
Copy link

@deepak1556 - I have tried 4.0.0-nightly.20181010 with the same test application as 3.0.
While 3.0 took about 40s to display a html test page as mentioned above, the nightly version came up almost instantly.
This means on my Notebook the problem is fixed with the nightly version!

@sxmpasch
Copy link

@deepak1556 - anything new on this? I wish I could help, but unfortunately, I don't get this to compile properly on my windows machine...

@deepak1556
Copy link
Member

@sxmpasch nothing new on my end.

don't get this to compile properly on my windows machine

What issue are you facing ?

@sxmpasch
Copy link

@deepak1556 - My Notebook is behind a proxy with username/password. When I tried last time, it got stuck somewhere with many errors/warnings. I have retried this today, he now is looking for gn.exe without being able to download anything...

@alejcas
Copy link

alejcas commented Dec 13, 2018

Same problem here, but on windows 8.1. I'm also behind a corporate proxy. I think that's the issue, because same electron version at home (without a proxy) starts instantly.

Tried installing version 4.0.0-beta9 and works instantly with proxy or not.

@nattajame27
Copy link

remove CDN in index.html :)

@cboillat
Copy link

cboillat commented Feb 8, 2019

Same problem here, but on windows 8.1. I'm also behind a corporate proxy. I think that's the issue, because same electron version at home (without a proxy) starts instantly.

Tried installing version 4.0.0-beta9 and works instantly with proxy or not.

Yes same here, all my private computers are not affected. Only my professionnal one behind a proxy is.

@gidbrn
Copy link

gidbrn commented Feb 21, 2019

Same problem here, but on windows 8.1. I'm also behind a corporate proxy. I think that's the issue, because same electron version at home (without a proxy) starts instantly.
Tried installing version 4.0.0-beta9 and works instantly with proxy or not.

Yes same here, all my private computers are not affected. Only my professionnal one behind a proxy is.

The problem occurs if you have a TMG Client (ISA Client). If you remove the TMG Client (instead of turning it off), the problem goes away.
(ATOM Editor + Windows 7 + TMG Client)

@cboillat
Copy link

@gidbrn tha's exactly the problem. I just uninstalled my TMG Client and everything is loading within a second !

@sofianguy
Copy link
Contributor

Thank you for taking the time to report this issue and helping to make Electron better.

The version of Electron you reported this on has been superseded by newer releases.

If you're still experiencing this issue in Electron v4.2.x or later, please add a comment specifying the version you're testing with and any other new information that a maintainer trying to reproduce the issue should know.

I'm setting the blocked/need-info label for the above reasons. This issue will be closed 7 days from now if there is no response.

Thanks in advance! Your help is appreciated.

@sofianguy sofianguy added the blocked/need-info ❌ Cannot proceed without more information label Aug 9, 2019
@sofianguy
Copy link
Contributor

Thank you for your issue!

We haven't gotten a response to our questions in our comment above. With only the information that is currently in the issue, we don't have enough information to take action. I'm going to close this but don't hesitate to reach out if you have or find the answers we need, we'll be happy to reopen the issue.

@deepak1556
Copy link
Member

@sofianguy this is still reported to happen with 6-1-x and higher, reopening to investigate further.

@tomocrafter
Copy link

It is still happening on me, with all of electron apps like Discord, VSCode, GitHub Desktop, Postman

@electron-triage electron-triage removed the blocked/need-info ❌ Cannot proceed without more information label Feb 20, 2020
@tomocrafter
Copy link

Is there any update about this issue? I still have this issue so far. I also tried windows safe-mode boot, disabling anti-virus, version electron 8.x.x demo app that can be launched with the command electron.
I would gladly like to help debugging by providing information so please ask me anything.
Or if you want to check my pc or actual behavior, then ask me for TeamViewer or something like that.
I'm done with this issue. Thank you.

@tomocrafter
Copy link

I fixed this problem by uninstalling badlion client. then all of electron apps launches within 1 sec.
Some people saying that in vscode issue. If you guys have this problem and have installed badlion client, then just uninstall it and restart the pc.
microsoft/vscode#56644 (comment)

@vicreinhart
Copy link

We have this problem also. 20 second wait time on Mac, 40 seconds on Windows 10 or 7. We are using Electron 8.2.5 and we have a coporate proxy.

@dnudler
Copy link

dnudler commented Jul 28, 2020

Happened to me the same. I had a 404 to a non existing css that I forgot to remove. Turned out removing that solved the 25 sec delay... Maybe this can help someone?

@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2022

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

@github-actions github-actions bot added the stale label Oct 8, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 8, 2022

This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests