Monday, 21 June 2021

Windows Defender slowing down Electron startup

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!



from Windows Defender slowing down Electron startup

No comments:

Post a Comment