Electron.NET icon indicating copy to clipboard operation
Electron.NET copied to clipboard

Startup performance is slow

Open vinnaykulkarni opened this issue 3 years ago • 10 comments

Application is taking nearly 90 seconds to start, post installation. Using Electron latest version and .Net Core 5

vinnaykulkarni avatar Feb 11 '22 06:02 vinnaykulkarni

It is something that is known, and that will be sought to be optimized in the next updates, as the creators of the repo said, as an aid the "splashscreen" was introduced, which is shown during the loading process of the application, so that the user does not think that the application did not start or that it froze.

ggomarighetti avatar Feb 13 '22 23:02 ggomarighetti

Hi @ggomarighetti thanks for the comment, I have enabled the splash screen, however, the 90 seconds time seems to be higher so was looking for help. Thanks for putting this as a known issue, will wait for the updates. @GregorBiswanger @robertmuehsig thanks for the Electorn.Net

vinnaykulkarni avatar Feb 14 '22 03:02 vinnaykulkarni

Unfortunately, malware developers use Electron too. So that under Windows the Windows Defender slows down the start. The only solution here would be to exclude realtime for your own app or to buy a certificate.

As a great comparison, open Visual Studio Code... and open a new, unknown electron app.. four seconds are only slowed down by windows defender.. a shame, because electron is based on the image, although electron is extremely powerful..

GregorBiswanger avatar Feb 15 '22 08:02 GregorBiswanger

Hi @GregorBiswanger thanks, will check adding to the exclusion of Defender and report back the status

vinnaykulkarni avatar Feb 15 '22 12:02 vinnaykulkarni

@GregorBiswanger checked adding to exclusion, there was very minor improvement seen, like out of 90 secs 20 secs were reduced

vinnaykulkarni avatar Feb 17 '22 10:02 vinnaykulkarni

Then there can be several other reasons that delay a startup. The most important rule is: measure. You need to profile where exactly the lag is happening. Is it the startup of .net? In most cases: yes. Because Electron is incredibly fast active.

GregorBiswanger avatar Feb 17 '22 10:02 GregorBiswanger

It often helps to reproduce the problem. If you can reproduce a "Hello World" and provide it to me on github, I'm happy to help.

GregorBiswanger avatar Feb 17 '22 10:02 GregorBiswanger

It is important to consider Windows Defender for the new project again.

GregorBiswanger avatar Feb 17 '22 10:02 GregorBiswanger

Thanks will check with the suggestions and update here

vinnaykulkarni avatar Feb 23 '22 04:02 vinnaykulkarni

@ggomarighetti @vinaykulkarni89 can you point to the named splash screen option you are talking about? I wish I could do something like Discord, which has a progress bar and everything while the update is downloading and installing all the way up to opening the window, is that somehow possible with said splash or another technique?

codingedgar avatar May 26 '22 16:05 codingedgar

🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉

With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!

P.S. On Windows, Windows Defender intervenes on a non-certified Electron app and delays the call by several seconds. If you add your project to Windows Defender under exclude, the application rips like a rocket.

GregorBiswanger avatar Mar 28 '23 15:03 GregorBiswanger