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.
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!
I am looking for a solution that doesn't require telling my users to modify their environment.
Another Windows Defender feature that may be responsible for slowing down your system is its Full Scan, which performs a comprehensive check of all files on your computer.
It is just the renderer, and just like a web app in a regular browser, it uses HTML, CSS and JavaScript to build an interface and provide functionality. Those are a lot of extra layers. And because of this additional abstraction, it can be slower than a finely tuned native app.
Developer claims that a Windows Defender bug could be sapping up to 6% of Intel CPU performance. Developer Kevin Glynn, aka "Uncle Webb," has discovered a weird Windows Defender bug that causes Intel CPUs to suffer a significant performance hit on Windows 10 or 11.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With