Skip to content

[Windows] Slow startup due to antivirus softwares #1487

Closed

Description

@felicienfrancois

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)

Activity

  1. CharlieHess commented on Apr 24, 2015

    @CharlieHess
    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.

  2. YurySolovyov commented on Apr 25, 2015

    @YurySolovyov
    Contributor

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

  3. jvkassi commented on Apr 26, 2015

    @jvkassi

    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

  4. anaisbetts commented on Apr 26, 2015

    @anaisbetts
    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

  5. YurySolovyov commented on Apr 26, 2015

    @YurySolovyov
    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?

  6. anaisbetts commented on Apr 26, 2015

    @anaisbetts
    Contributor

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

  7. felicienfrancois commented on Apr 27, 2015

    @felicienfrancois
    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.

  8. zcbenz commented on Jan 6, 2016

    @zcbenz
    Contributor

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

  9. fritx commented on Jul 20, 2016

    @fritx
    Contributor

    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.

  10. xland commented on Jun 22, 2022

    @xland
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions