Slow initial app window opening, but only in certain situations?
So it seems that the app is for an as yet unknown reason tied-up opening its com.organisation.AppName.savedState from ~/Library/Saved Application State/. I found this out by using FSMonitor whilst launching the app and confirmed it using AppCleaner. 

Looking inside the .savedState file I can see that there's a file restorecount.plist, present for exactly as long as the delay, which contains an incremented number which on my install of macOS is about 544,000,000 right now. Half a billion windows restored since Mac OS X 10.7 Lion! The ID seems to be system level, as even the Guest user has roughly the same number in its savedState files.


  I'm still interested to know why a new account has faster generation of the restorecount.plist file whilst "old" accounts can be a lot slower.




The workaround is to either:


per-user: enable System Preferences &gt; General &gt; Close windows when quiting an app
per-app: in Terminal defaults write com.organisation.AppName NSQuitAlwaysKeepsWindows -bool false which stores it in the app's preference file at ~/Library/Preferences/.


Further discussion at this GitHub issue.