首页 > 解决方案 > 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:

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:

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.

标签: javascriptwindowsperformanceelectronwindows-defender

解决方案


您最好的选择是将您的可执行文件作为示例提交给 MS Defender Team 以供审核:https ://www.microsoft.com/en-us/wdsi/filesubmission,请在评论中提及您的问题。他们几乎每天都会发布防御者更新,所以这应该没什么大不了的

您可以帮助自己的另一件事是将您的 exe 放入 Defender AV 的排除列表中(大多数 Microsoft 受信任的位置通常都在排除中),所以这应该是轻而易举的事。

当然,同时与 Microsoft 一起打开一个案例来帮助您。


推荐阅读