[snap] Chromium snap starts slowly

Bug #1847069 reported by chanath
80
This bug affects 17 people
Affects Status Importance Assigned to Milestone
chromium-browser (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

The problem is shown here, https://discourse.ubuntu.com/t/call-for-testing-chromium-browser-deb-to-snap-transition/11179/141 more graphically.

Chromium snap takes quite a while to start and doesn't carry the system theme, whereas the chromium-browser folder taken off the snap/chromium starts practically immediately.

The libcanberra-gtk3-module is missing inside the snap, and cannot use the module in the system.

The Chromium snap is 607.3 MB, while the standalone Chromium is 237.2 MB, taken off the snap.

Conclusion on Chromium snap on Ubuntu Eoan;
Two bugs and a missing module
1) Starts slowly,
2) Cannot carry the system theme,
3) Doesn't have libcanberra-gtk3-module

Tags: snap
Revision history for this message
Olivier Tilloy (osomon) wrote :

Thanks for the report. However, reporting several different issues in one bug report is not helpful, it complicates tracking of the individual issues.

Regarding issue #1, can you run the following command in a terminal, wait for the chromium window to show, then close it, and share the output?

    snap run --trace-exec chromium

Issue #2 is a known bug: bug #1800260.

Issue #3 can be safely ignored, the warning is harmless.

summary: - Chromium snap starts slowly and doesn't have one module
+ Chromium snap starts slowly
Changed in chromium-browser (Ubuntu):
status: New → Incomplete
summary: - Chromium snap starts slowly
+ [snap] Chromium snap starts slowly
tags: added: snap
Revision history for this message
chanath (chanath) wrote :

snap run --trace-exec chromium
Gtk-Message: 18:32:40.563: Failed to load module "canberra-gtk-module"
Gtk-Message: 18:32:40.622: Failed to load module "canberra-gtk-module"
[5362:5516:1007/183243.311274:ERROR:token_service_table.cc(140)] Failed to decrypt token for service AccountId-102562585832489293610
[5487:5487:1007/183244.184312:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[5487:5487:1007/183247.688629:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command

Revision history for this message
Olivier Tilloy (osomon) wrote :

You need to close the application after the window became visible, for "snap run --trace-exec" to display useful information about what system calls are consuming CPU time at startup.

Revision history for this message
chanath (chanath) wrote :

Gtk-Message: 21:16:33.373: Failed to load module "canberra-gtk-module"
Gtk-Message: 21:16:33.463: Failed to load module "canberra-gtk-module"
[2727:2897:1008/211636.183693:ERROR:token_service_table.cc(140)] Failed to decrypt token for service AccountId-102562585832489293610
[2869:2869:1008/211637.607402:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[2869:2869:1008/211641.021952:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command
Slowest 10 exec calls during snap run:
  0.593s snap-update-ns
  1.130s /usr/lib/snapd/snap-confine
  1.472s /snap/chromium/861/bin/desktop-launch
  0.214s /usr/bin/dbus-send
  0.235s /snap/chromium/861/bin/chromium.launcher
  0.278s /usr/bin/dbus-send
  0.361s /usr/bin/xdg-settings
  20.135s /proc/self/exe
  28.398s /snap/chromium/861/usr/lib/chromium-browser/chrome
  20.416s /proc/self/exe
Total time: 31.631s

Revision history for this message
chanath (chanath) wrote :

To compare,

~$ time ~/chromium-browser/chrome
[5072:5072:1008/212843.785778:ERROR:sandbox_linux.cc(369)] InitializeSandbox() called with multiple threads in process gpu-process.
[5072:5072:1008/212844.165025:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error from previous GL command

real 0m5.087s
user 0m6.032s
sys 0m1.318s

Olivier Tilloy (osomon)
Changed in chromium-browser (Ubuntu):
status: Incomplete → New
Revision history for this message
chanath (chanath) wrote :

The status is NOT incomplete, as I am writing from the Chromium browser taken OFF the snap, leaner and snappier. Have a good day!

Revision history for this message
chanath (chanath) wrote :

It cannot be corrected, can it?

Revision history for this message
Olivier Tilloy (osomon) wrote :

I'm not following you. What cannot be corrected?

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in chromium-browser (Ubuntu):
status: New → Confirmed
Revision history for this message
Anıl (anlyldz27) wrote :

18.04.3 chromium snap start serious slow. Im not try yet deb but preinstalled firefox just opening 2 sec.

Revision history for this message
Lorenz Brun (lorenz-x) wrote :

I'm also experiencing very slow Chromium with the new Snap (both during startup and stuttering during runtime). I've done some cursory profiling and it looks like the culprit is SquashFS with lzma. LZMA by itself is very slow to decompress (zstd would be much more appropriate for snaps, being much faster and only a tiny bit bigger) and SquashFS is very slow because of the way IO is done and caching. Google even carries custom patches for Android (https://android-review.googlesource.com/q/topic:squashfs) since it's so slow, but they weren't upstreamed because they removed an old caching mechanism that the maintainers wanted to keep (https://lore.kernel.org/patchwork/patch/833639/).

If Ubuntu wants to ship important software (like Chromium) as Snaps, you really need to fix both of those things, because right now it's nearly unacceptably slow (even on a beefy system with NVMe Flash/8 Cores/32GiB RAM). Using EROFS would also work, but since that is not available in the current Ubuntu kernel that is unlikely to happen.

Revision history for this message
Olivier Tilloy (osomon) wrote :

Lorenz, would you mind sharing your insights on squashfs with LZMA performance on the snapcraft forums (https://forum.snapcraft.io/) ?

I'm sure the snapd team would be interested in looking at potential performance improvements.

Revision history for this message
Ian Johnson (anonymouse67) wrote :

@lorenz-x note that all snaps today actually use XZ compression, not LZMA. I did some investigation into which compression option would give the best performance for snaps on the snapcraft forum at https://forum.snapcraft.io/t/squashfs-performance-effect-on-snap-startup-time/13920. We would appreciate your input there where we (the snapd team) have more visibility on the issue.

Revision history for this message
Jalon Funk (francescohickle15) wrote :

"note that all snaps today actually use XZ compression, not LZMA."

xz = LZMA2 ( https://tukaani.org/xz/ ) which I guess is what was referenced above.

Revision history for this message
Ian Johnson (anonymouse67) wrote :

Ah sorry my apologies I confused LZMA and LZO...

Revision history for this message
tommy bergeron (tomshreds) wrote :

APT forced me to stop using the DEB version and start using the Snap version and I can confirm it is much slower to start on Ubuntu 19.10 (5.3.0-26)

Revision history for this message
Karl-Heinz Ziessow (zihuhu) wrote :

Turn off hardware acceleration did the job for me.
See: https://support.google.com/chrome/thread/2331445?hl=en

Revision history for this message
Karl-Heinz Ziessow (zihuhu) wrote :
Download full text (3.2 KiB)

Sorry, it is not the hardware acceleration. Strange enough, the slow startup only happens at first startup (some 30secs) and disappears thereafter.

~$ snap run --trace-exec chromium
Gtk-Message: 16:49:03.254: Failed to load module "canberra-gtk-module"
Gtk-Message: 16:49:03.441: Failed to load module "canberra-gtk-module"
[3303:3303:0308/164903.689952:ERROR:edid_parser.cc(102)] Too short EDID data: manufacturer id
[3446:1:0308/164908.592828:ERROR:child_process_sandbox_support_impl_linux.cc(79)] FontService unique font name matching request did not receive a response.
[3446:1:0308/164908.606411:ERROR:child_process_sandbox_support_impl_linux.cc(79)] FontService unique font name matching request did not receive a response.
[3303:3433:0308/164910.260469:ERROR:udev_watcher.cc(96)] Failed to begin udev enumeration.
Slowest 10 exec calls during snap run:
  0.218s snap-update-ns
  0.387s /snap/core/8689/usr/lib/snapd/snap-confine
  0.178s /usr/lib/snapd/snap-exec
  0.679s /snap/chromium/1043/bin/desktop-launch
  0.214s /snap/chromium/1043/bin/chromium.launcher
  0.248s /usr/bin/dbus-send
  0.307s /usr/bin/xdg-settings
  37.788s /proc/self/exe
  42.106s /snap/chromium/1043/usr/lib/chromium-browser/chrome
  37.914s /proc/self/exe
Total time: 43.673s

~$ snap run --trace-exec chromium
Gtk-Message: 16:51:42.452: Failed to load module "canberra-gtk-module"
Gtk-Message: 16:51:42.460: Failed to load module "canberra-gtk-module"
[4082:4082:0308/165142.507754:ERROR:edid_parser.cc(102)] Too short EDID data: manufacturer id
[4227:1:0308/165144.923011:ERROR:child_process_sandbox_support_impl_linux.cc(79)] FontService unique font name matching request did not receive a response.
[4227:1:0308/165144.932876:ERROR:child_process_sandbox_support_impl_linux.cc(79)] FontService unique font name matching request did not receive a response.
Slowest 10 exec calls during snap run:
  0.168s /snap/core/8689/usr/lib/snapd/snap-confine
  0.025s /bin/ln
  0.428s /snap/chromium/1043/bin/desktop-launch
  0.037s /usr/bin/cut
  0.035s /usr/bin/dbus-send
  0.036s /usr/bin/dbus-send
  0.124s /snap/chromium/1043/bin/chromium.launcher
  3.882s /proc/self/exe
  5.419s /snap/chromium/1043/usr/lib/chromium-browser/chrome
  3.898s /proc/self/exe
Total time: 6.222s

~$ snap run --trace-exec chromium
Gtk-Message: 16:51:59.566: Failed to load module "canberra-gtk-module"
Gtk-Message: 16:51:59.585: Failed to load module "canberra-gtk-module"
[4299:4299:0308/165159.637753:ERROR:edid_parser.cc(102)] Too short EDID data: manufacturer id
[4448:1:0308/165201.970950:ERROR:child_process_sandbox_support_impl_linux.cc(79)] FontService unique font name matching request did not receive a response.
[4448:1:0308/165201.975635:ERROR:child_process_sandbox_support_impl_linux.cc(79)] FontService unique font name matching request did not receive a response.
Slowest 10 exec calls during snap run:
  0.166s /snap/core/8689/usr/lib/snapd/snap-confine
  0.025s /bin/ln
  0.426s /snap/chromium/1043/bin/desktop-launch
  0.037s /usr/bin/cut
  0.038s /usr/bin/dbus-send
  0.034s /usr/bin/dbus-send
  0.125s /snap/chromium/1043/bin/chromium.launcher
  3.159s /proc/self/exe
  4.570s /snap/chromium/1043/usr/lib/chromium-brow...

Read more...

Revision history for this message
Lagoda (florent-lagoda) wrote :

Same problem for me,
I hate snap more and more

Revision history for this message
Piotr Henryk Dabrowski (phd) wrote :

Chromium snap starts slowly also in 20.10 Hirsute.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.