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

[Windows] Slow startup due to antivirus softwares #1487

Closed
felicienfrancois opened this issue Apr 24, 2015 · 10 comments
Closed

[Windows] Slow startup due to antivirus softwares #1487

felicienfrancois opened this issue Apr 24, 2015 · 10 comments

Comments

@felicienfrancois
Copy link

I had a quite slow startup on windows so I made some benchmarks and found that most antivirus softwares are highly slowing startups on windows.
Also @romovs #1474 was probably due to this.

This happens at every startup, even on a app that have been cleanly installed with a signed installer.

I tested with an empty app (just start main crash reporter, open one empty window and start renderer crash reporter), on Windows 8.1 64bit, electron 0.25.1 x64.
Results:
Whithout any antivirus
Total startup time (from main thread start to ready event): **~ 150ms**
Details:

  • Main thread start: instantaneous
  • Main crash reporter: <20ms
  • BrowserWindow creation and loading: ~ 100ms
  • Browser crash reporter: <20ms

With avast 2015
Total startup time: >1500ms
Details:

  • Main thread start: not instant but quick
  • Main crash reporter: ~350-400ms
  • BrowserWindow creation and loading: ~ 800ms
  • Browser crash reporter: ~350-400ms

With Panda Free Antivirus
Total startup time: >7000ms
Details:

  • Main thread start: ~1500-2000ms
  • Main crash reporter: ~1000ms
  • BrowserWindow creation and loading: ~ 3000ms
  • Browser crash reporter: ~1000ms

I have not tested with more antiviruses but I think they all have the same sandbox / execution watcher features.
6s for an empty app startup is a real issue and I can't tell my users to disable their antiviruses to make my app boot normally.

I'll try to enquire more on what could cause such slowdown and are the usual solutions but I think that's a concern for all electron app (including atom)

  • Is their a way to sign the app itself which would prevent this ?
  • Is their some exclusion process or registration against antiviruses ?
  • Is their a way to prevent this from happening at each startup ?
  • Is there some operation in electron that should be done differently (or integrated differently regarding io.js) ?
  • Is there some read/write pathes that are particularly watched by antiviruses ? (could be related to Cache directory on windows should be %localappdata% by default #1404)
@CharlieHess
Copy link
Contributor

We've definitely been noticing this with Slack. Some AV block our network traffic outright, resulting in blank white-screens and confounded users. The better vendors (AVG, Kaspersky) have false positive forms that you can fill out, typically linked from their Support page. Some of them are fascists and will ask that you reproduce the issue (requiring you to first pay for their product or install a trial) and send them the logs from an instance when the app is blocked (here's looking at you, Symantec).

When filing these whitelist requests, I've thus far included details about Electron / Squirrel and pointed out that these problems will apply to a number of other applications. So hopefully at some point we can reach a critical mass.

@YurySolovyov
Copy link
Contributor

How does plain Chrome / Chromium compare to that? If it doesn't get affected, then Electron does something wrong.

@jvkassi
Copy link

jvkassi commented Apr 26, 2015

Definitly right.
I think it's because of the application is from an "unknown publisher"
When you launch electron.exe even without AV, windows warn you with an elegant message.
publisher

The app "electron.exe" must be signed
ref: https://msdn.microsoft.com/en-us/library/windows/desktop/aa387764%28v=vs.85%29.aspx

@anaisbetts
Copy link
Contributor

How does plain Chrome / Chromium compare to that? If it doesn't get affected, then Electron does something wrong.

This isn't necessarily true, AV software often just has flat-out whitelists - Chrome will naturally be in that list, and we won't

@YurySolovyov
Copy link
Contributor

sigining an app can be expensive, and I'm not sure it will help a lot, maybe there are trials for that, so we can test if there are any difference?

@anaisbetts
Copy link
Contributor

afaik Atom is already signed by GitHub, if you're building it yourself this might be a contributing factor

@felicienfrancois
Copy link
Author

How does plain Chrome / Chromium compare to that? If it doesn't get affected, then Electron does something wrong.

Chrome seems not affected by antiviruses but:

  • Chrome runs in sandbox mode (while electron does not)
  • as said @paulcbetts, Chrome is naturally whitelisted
  • nodejs/iojs seems to be affected. Some antiviruses (like Panda) may slow down or break execution of some nodejs programs (I experience it with grunt tasks)

I think it's because of the application is from an "unknown publisher"
When you launch electron.exe even without AV, windows warn you with an elegant message.

I have just tested to sign the app with a valid authenticode certificate (GlobalSign) and there is no changes with panda antivirus (not tested with avast). I signed both .exe and .dll files.
Signing prevent from getting "Unknow publisher" warning and to pass smartscreen check but does not seems to be taken into account by antiviruses (or maybe when the certificate have been used to sign withelisted app ?)

afaik Atom is already signed by GitHub, if you're building it yourself this might be a contributing factor

atom executable is signed but not electron ones.
It's fine because signing may prevent developers from changing icons and metadata of the executable.
But DLLs from electron are not signed at all. DLLs should be signed too and I think it should be signed by electron.

@zcbenz
Copy link
Member

zcbenz commented Jan 6, 2016

I'm closing this since there is nothing we can do on Electron's side.

@zcbenz zcbenz closed this as completed Jan 6, 2016
@fritx
Copy link
Contributor

fritx commented Jul 20, 2016

BrowserWindow creation and loading: ~ 3000ms

BrowserWindows are really slow on our Windows machines!
However, I wonder why NW.js doesn't have the same problem.

@xland
Copy link
Contributor

xland commented Jun 22, 2022

#32375

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

8 participants