Uninstalled snapd - reduced boot times drastically?

So, I saw in a thread yesterday or this morning someone had reduced their boot time by 10 full seconds, just by removing the snapd package. 10 seconds!??! I was blown away to imagine. And being a rainy quarantined Monday, I figured, let's break my computer and give it a shot. I completely shut down, and started up. 18.6 seconds total for me.

I only had one application downloaded by snap - skype. I completely removed skype, and then removed snapd, and tried again. 18.6 seconds down to 12.8 seconds. . .

Holy hell. I just saved 6 seconds or 30% on my boot time by uninstalling 1 package I don't really need.

Has anyone else seen or had this experience? What gives that makes it SO heavy on bootup? Or is it just me and one other person who have seen this and we're just outliers?

Edit: This was the comment that peaked my interest to give this a shot. I couldn't believe it. Thanks @TechnikHiLL

3 Likes

I have one installation with snapd running but no snaps and don't see that there.
Perhaps skype-snap was the culprit.

Skype is often set to autostart, was that your case, too? Then it indeed might have slowed the startup process and not snapd as such.

snaps and runtimes get mounted at startup, so once you install a snap you will likely have 3-5 things getting mounted. I have not seen that to cause much real world slowdown but all of my machines have SSDs.

In a related-but-not-Manjaro Plasma install on a 9th Gen Intel-only desktop rig, Snapd with NO Snaps installed, added 1/10th a second to startup.

Posted per @eugen-b's suggestion. :wink:

EDIT: Since @eugen-b is being goofy today, I won't be stingy:

Test w/Snapd & No Snaps: * Test w/Snapd:
Startup finished in
4.926s (firmware) + 2.541s (loader) + 2.474s (kernel) + 1.869s (userspace) = 11.811s

  • 456ms snapd.service

  • 5ms snapd.socket

  • End Test w/Snapd

Test w/o Snapd services:
Startup finished in
4.839s (firmware) + 2.494s (loader) + 2.525s (kernel) + 1.842s (userspace) = 11.701s

3 Likes

It certainly could be. I added skype back in from AUR, and I'm still in that 12.5-13 second window. It could have been.

No. It was/is not autostart.

I'm currently on ACHI Pcie SSD w/ 16gb RAM on a 2015 Lenovo X1 Carbon.

1 Like

Just think how much of your life you get back by removing it....

If you start your machine once per day that is 36.5 seconds per year.

2 Likes

When you're my age, every frikken second counts! :man_bald:

4 Likes

So I added back ONLY snapd, and it added less than a half second. So, if it's not snapd itself. Is it that it has to mount packages at startup. That seems like a very inefficient way to do things? If you install a whole bunch of snap packages, it could be adding a lot of extra time to your boot process.

2 Likes

Like I said, I haven't seen any delays on my system from those mounts. Maybe it was the actual snap you had installed.

Try installing a different snap and see how much delay is added.

1 Like

Anything - literally anything - which needs initialization will take time.

That fact alone should be common knowledge.

I had a conversation relating to initializing nvm.sh and in that conversation it was related that 0.2s was an issue for initializing the terminal :confounded:.

If you want to have a fancy terminal prompt you source oh-my-zsh.sh - if you want to use node.js without interfering with your system you source nvm.sh and if you are also using Python virtual environments you may be sourcing virtualenvwrapper.sh.

I mean drastically reducing load times - this all depends on what you are doing - and as stated in other threads - opening a terminal with all the above enabled - I can type 2 chars if I am impatient - I don't have to retype - it's just the init that is garbled in a non important manner.

Yes snapd it will take time on your initial boot - but you will accept that because your are using snaps - just as I am using nodejs or virtualenv - just never in the same terminal - but those are the sacrifices we make.

2 Likes

I'm not talking 0.2 seconds. OBVIOUSLY initialization takes time. but going from 12 or 13 seconds of boot time to 18-19 is not trivial, and you're smart enough to know that. That's literally 30% more time. If it had been 0.2 seconds I wouldn't have even bothered with this thread.

I'm downloading onlyoffice now. I'll see if it's the same results or not.

1 Like

Indeed - which is why I don't use snap :slight_smile:

And my comparison was only to non-trivial initialization vs. kernel initialization where the latter - obviously - will occupy more time.

3 Likes

The problem is not the snapd system in of itself. The problem is that every snap gets mounted on startup, even if it will not be started on startup. You probably had 4-5 snaps installed i would guess?


Nowadays with the addition of flatpaks to pamac i don't even use snapd anymore for that reason and more.

1 Like

Only office added about another 0.6 seconds to boot time. I added onlyoffice this time. Adding snapd + only office added a full second to boot. Skype must the biggest culprit, but even still, adding .5-X seconds to every single downloaded package if you had 10-15 it could add huge times to your boot sequence. That still seems like an exorbinant amount considering everything. It's enough where I certainly won't be downloading snaps unless there's literally no other way, and it's required for something.

I just thought it was crazy someone had saved so much boot time from one thing, and I was able to replicate it. I figured there must be more.

1

2 Likes

The first thing I always did after installing Manjaro: sudo pacman -R snapd so I never really had the chance to compare the boot times. :smiley:

3 Likes

snapd equals 370 ms at start for me.
(but I thought I remembered seeing it in the ~1.Xs range .. I did clear fonts after the tofu font issue)

Hey @fbodymechanic :wave:

I am glad this helped you and made you open a thread on the issue. Snaps are nasty!
Anybody having a slow boot should should try out the below command if they don't know about it and see the snapd processes and how much time they're taking!

systemd-analyze blame.

Snapd's contribution as per systemd-analyze blame to my boot was 9.956 seconds!! (just calculated the time again) :slight_smile:

The snap debt increases more and more over time as your snap number increases along with GTK + QT run times installed! So if you can sacrifice GTK or QT snaps, it might save some boot times if you still have to use snaps. I switched to flatpaks and dropped QT apps to save time for a while until I removed all the snaps! :slightly_smiling_face:

Hope the increasing questions against snaps makes better awareness before we are all thrown under the snap bus. Manjaro already have snaps bundled in Manjaro ISO's and Manjaro edition built on top of snaps could be on the way too. :crossed_fingers::smiley:

3 Likes

I won't have it or use them in my computers anymore unless it's literally my only option for something I need.

We'll see how it goes in the future, I guess it depends on your computer. Some of us it makes a big difference, others who probably aren't running any, it's negligible. It's just take important people realize what it can do.

Yep, for example, if you don't have snaps installed but just snapd installed (Because it came bundled with Manjaro ISO maybe?), it won't have much impact. I guess that is what happened with @c00ter's snap test maybe? I am not sure.

This is for people who will depend on snaps. A lot of the thrid party apps have official releases through snapstore like VSCode, Slack, Gitkraken, Telegram. For them, the impact will be more.

But hey, you should be able to get the software as Flatpak, AUR or Appimages. Because none of them has this issue. :man_shrugging: :wink:

Forum kindly sponsored by