Slow startup of applications

I have a question about the slow startup time of applications on my desktop computer. Most applications take very long to start the first time I use them since a fresh boot of the system. I’m talking about several seconds to almost a minute. Flatpak applications tend to take more time to start than apt packages. When I close the application and restart it again (without rebooting my system) then they all startup very fast.

Some examples:

  • Foliate (flatpak) 21 sec
  • ReText (flatpak) 57 sec
  • Libre Office (flatpak) 32 sec
  • VS Code (apt) 5 sec
  • Neovim (apt) (in terminal) 5 sec

Could the cause for this be the fact that I mapped my complete home-directory (with all configurations) to a second internal SATA-harddisk? If so, why?

Some specs of my pc:

  • Pop!_OS 22.04
  • Intel Core i7-9700 CPU 3.00GHz*8
  • 32 GiB ram
  • NVIDIA GP107 [GeForce GTX 1050 Ti]
  • system drive: nvme 1TB
  • data drive: SATA 1 TB (drive to which my home folder is mounted. This disk has one volume with one partition (EXT4). I mount my home-folder to /home on this disk).

No, because these programs should reside under /usr, not /home. At least the apt ones that is, I don’t remember where flatpaks extract themselves, but I don’t think it’s /home (given that you require root to install flatpaks IIRC).

I suspect a failing drive, or a drive that is almost filled up. Programs like neovim should launch instantaneously. Do a backup, then run a fsck on both drives.

2 Likes

And check the smart stats (you need to look up how for your manufacturer).

@ThatGuyB Thanks for your replies. I will check it somewhere coming days and let you know the results.

My flatpaks are installed in $HOME/.var/app/. . . and not to /usr/??.

I’m guessing that yours are too, hence the fairly slow time to load them into memory (drive cache).

@BillMair My flatpaks are indeed installed in $HOME/.var/app. I did install them as user and not systemwide. That could explain the slow start-up of these applications, yes. Didn’t think of that myself, thanks for noting this.

Than there is still the slow startup of apt packages. @ThatGuyB SMART tests show no errors on the disks and fsck on my data disk went fine as well (both short and long test). I still have to do a check on my systemdisk…

If your disk is fine, I think you’re likely facing a bug or something. Can’t tell what.

@BillMair After removing the user install of LibreOffice I wanted to install it systemwide. But it seems that Pop!_OS by default only uses the user remote. So I added the system remote by flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo. Now when I list all remotes by flatpak remotes I see:

Name    Options
flathub system
flathub user

After installing LibreOffice systemwide by flatpak --system install org.libreoffice.LibreOffice it is really installed systemwide. Startup time went from 32 seconds to within a second :grinning:

Nice. You learned to analyse and how to fix the problem. Congratulations!

1 Like