standardnotes / desktop

[Moved to https://github.com/standardnotes/app] A free, open-source, and end-to-end encrypted notes app. https://standardnotes.com
GNU Affero General Public License v3.0
1.4k stars 115 forks source link

App slow to start up #872

Open mrankine opened 2 years ago

mrankine commented 2 years ago

At some point in the last couple months, the SN desktop app suddenly became much slower to start.

I timed it at between 13-20 seconds. There's no window, nor any sign of activity, until the last second. So it's easy to assume I've mis-clicked the app icon and try to launch it again. SN is starting significantly slower than Chrome or Excel or Word or VS Code.

I'm on 3.14.1 but it was also an issue on 3.9.*.

I have 726 notes, just short pieces of text. The SN backup txt file is only 1.6Mb.

Machine is a 2014-vintage Dell XPS 13 with i7-3537U, 8Gb, Windows 10 Pro 21H2. So not the fastest, but other apps (including Electron) don't have this long pause before anything appears to happen.

mrankine commented 2 years ago

Still an issue in 3.20.0, which I just timed at ~15 seconds to start up (again, with no window appearing until the last second).

moughxyz commented 2 years ago

Hmm that's strange. Can you click the top level Help > Open data directory, then quit the app. After it quits, delete all files and folder in that directory, and reopen the app. Only do this if your data is properly synced to your account. If no account then we can try something else.

mrankine commented 2 years ago

Thanks! Tried it, no change, still 15 second start up times. I haven't yet signed back again, so it doesn't seem related to my account or data.

I watched Task Manager on start up. There's one Standard Notes.exe process initially (25-30Mb memory), a long pause, then a second process, long pause, then the remaining 2 launch only at the last moment, when the SN window is drawn. (For me, in steady state, SN has 4 processes).

moughxyz commented 2 years ago

Very strange. Can you try downloading standard-notes-3.20.0-win-x64.exe from here? https://github.com/standardnotes/desktop/releases/tag/v3.20.0

Curious if maybe your executable is using the wrong architecture.

mrankine commented 2 years ago

Thanks, no change with a fresh install. Also tried uninstalling and installing from scratch, but no change.

However - I watched Task Manager during SN startup - and saw that the long pause exactly matches the Antimalware Service Executable process jumping from idle to 25-50% CPU usage (minimal disk usage) - then back to idle when the SN window is drawn. As far as I know my Windows Security and Defender setup is pretty standard, definitions were updated this morning.

moughxyz commented 2 years ago

Hmm. I honestly can't guess as to why this is happening. It's the first such report I hear about this particular issue. A few countermeasures I can recommend would be to enable minimizing to task tray for SN so that it at least doesn't quit out all the time (if that's possible for your arrangement), and to also fallback to the web app if desktop becomes fully unbearable.

As a debugging measure you can perhaps try tinkering with your local firewall/malware settings temporarily to see if that truly does affect startup time.

mrankine commented 2 years ago

Thanks, I'll give those tips a try.