Windows Defender slowing down Electron startup

Viewed 2006

Context

I have setup a trivial Electron app which shows a plain html file and it consistently takes more than two seconds to start up. The key performance measurements are:

  • 170 ms: a blank window appears on the screen
  • 2800 ms: the window shows the specified HTML

After asking about it, I discovered that the problem is caused by Windows Defender. Disabling its real-time protection gets us an acceptable startup speed:

  • 150 ms: a blank window appears on the screen
  • 500 ms: the window shows the specified HTML

While this speedup solves the problem completely, it is a no-go to ask users to disable Windows Defender in order to have faster startup.

Question

I have observed some popular Electron apps, like Visual Studio Code, have normal startup time so I assume there is a way to achieve that without disabling Windows Defender. The question is: how?

The only thing that comes to my mind is signing the electron binary, in the hope that it solves the problem. But since a signing certificate costs money I'd rather be sure I need it before going down this route. It would be great if someone with experience on this area could chime in!

Requirement

I am looking for a solution that doesn't require telling my users to modify their environment.

1 Answers

Your best bet would be to submit your executable to MS Defender Team as sample for review at: https://www.microsoft.com/en-us/wdsi/filesubmission, mention in comment your issue. They are releasing defender updates almost daily basis so it should not be a big deal

One more thing you can help yourself with is to get your exe in the exclusion list of Defender AV (mostly Microsoft trusted locations are often in exclusions) so it should be no brainer.

And of course open a case with Microsoft in parallel to help you there.

Related