slow calculator startup

Bug #1797734 reported by SYN-2009 on 2018-10-14
132
This bug affects 29 people
Affects Status Importance Assigned to Milestone
gnome-calculator (Ubuntu)
High
Ken VanDine
ubuntu-meta (Ubuntu)
Undecided
Unassigned

Bug Description

The calculator starts very slowly. It's a tiny program, but it runs like a very big one. In previous versions of Ubuntu, the launch was normal, very fast.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: gnome-calculator (not installed)
ProcVersionSignature: Ubuntu 4.15.0-36.39-generic 4.15.18
Uname: Linux 4.15.0-36-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 2.20.9-0ubuntu7.4
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Sun Oct 14 08:40:06 2018
InstallationDate: Installed on 2018-05-06 (160 days ago)
InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
ProcEnviron:
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=ru_RU.UTF-8
 SHELL=/bin/bash
SourcePackage: gnome-calculator
UpgradeStatus: No upgrade log present (probably fresh install)

SYN-2009 (ra9uek) wrote :
tags: added: snap
description: updated
Launchpad Janitor (janitor) wrote :

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

Changed in gnome-calculator (Ubuntu):
status: New → Confirmed

This is a problem on 18.10 Cosmic Cuttlefish, as well. Embarrassingly slow for a simple application like this.

Cory Bloor (slavik81) wrote :

At least on Ubuntu 18.04, I found that the version from the apt package starts up much faster than the snap version. I ended up swapping them using `sudo snap remove gnome-calculator && sudo apt install gnome-calculator`

Sebastien Bacher (seb128) wrote :

Could those having the issue copy the output of this command in the bug?
$ snap run --trace-exec gnome-calculator

Piotr Dąbrowski (piotrdab) wrote :

Here's my trace. You can see the first launch takes around 2 seconds. Second run takes significantly less time. In both cases `/snap/gnome-calculator/406/bin/desktop-launch` is what takes most of the time during startup.

Quick spec:
- Intel(R) Core(TM) i5-8400 CPU @ 2.80GHz
- Corsair Force MP510 M.2 NVMe SSD

Sebastien Bacher (seb128) wrote :

Thanks, the first use is still probablematic indeed. Do you consider 2 seconds as too slow?

Daniel van Vugt (vanvugt) wrote :

On many keyboards there is a dedicated Calculator button so you may expect a fast launch. I use the deb version of gnome-calculator for this reason, and it launches apparently instantly. So I understand if a few seconds seems too long by comparison.

Piotr Dąbrowski (piotrdab) wrote :

2 seconds it way to slow for simple application like this on a system installed 6 days ago on a quite good machine. Firefox opens way faster.

Up until recently I've been using a HDD (instead SSD) for my system drive and back then it took around 6-10 seconds to start the calculator (and it was also slower than Firefox), so I guess 2 vs 6 seconds is just a scale according to how fast is the hardware. I could upload the trace from my low-spec personal laptop (last trace comes from my work PC), where this is also problematic.

Ken VanDine (ken-vandine) wrote :

We can further improve this now that we have layouts. Once the snapcraft gnome extension lands, I'll look into adding that to the extension.

Changed in gnome-calculator (Ubuntu):
assignee: nobody → Ken VanDine (ken-vandine)
importance: Undecided → High
Valentin Crone (va-crone) wrote :

Hello,
Try to remove the snap package:

snap remove gnome-calculator

And install the deb package:

apt-get install gnome-calculator

I have experimented this on Ubuntu 18.04 and 19.04 and it seem to be really faster.
I have experienced many speed problems with snap apps. And some was really laggy.

For example, with discord on snap, on one of my laptop: crashes, and mic problems.
For the other laptop: Really laggy, 5 to 10s between the time I type something, and the time it appear on the screen, on a laptop with 2 SSD.
I have the time to start firefox 3 times on the same period, and discord in firefox doesn't present any of theses problems.

After this, I remove the snap version, and install the official deb version (from the discord website), and no problems. Fluid and not full of bugs.

Same problem for Atom (atom.io), buggy and laggy with snap.
I don't understand why snap is slow like this for certain apps, and I don't understand exactly how snap works, but I suspect him to be the cause of many slow apps on recent versions of Ubuntu.

On my laptop, for gnome-calculator, the time to open:
- Snap: 2 to 10s
- Deb: 0.1 to 1s

I can't say it's definitely snap, but I suppose you can look at this.

Hi, Ubuntu 18.04.3 LTS running on SSD laptop with 16GB ram and i7 cpu here, i can confirm that startup was very slow and was solved doing:

$ snap remove gnome-calculator
$ sudo apt-get install gnome-calculator

Before the "snap remove" startup time was as minimum 10 secs, now is 1 sec or less.

tags: added: performance

This problem persists on Ubuntu 20.04. See this proposal to remove the snap version of the package: https://discourse.ubuntu.com/t/proposal-for-ubuntu-20-04lts/12969/92

Moreover, the apt package cannot currently be found on Ubuntu 20.04. Diagnosis:

sudo snap remove gnome-calculator
sudo apt-get install gnome-calculator

Expected output:

apt gnome-calculator successfully installed.

Actual output:

No apt package "gnome-calculator", but there is a snap with that name.
Try "snap install gnome-calculator"

tags: added: focal
tags: added: champagne
Sebastien Bacher (seb128) wrote :

untagging, that's being worked but not specific enough to be rls tracked

tags: removed: champagne
Paul Smith (psmith-gnu) wrote :

I'm not sure why the "is 2s too slow to start" is the question being asked. Who starts and stops their calculator multiple times in a row? That's not a realistic use-case for the vast majority.

Most people need a calculator once a day or every few days, and a desktop calculator is not an application people tend to leave running for long periods like a browser or word processor. They need to do a quick bit of computation so they open the app, work in it for a few minutes, then close it again. Startup speed is, after correctness, probably THE most important aspect of a utility like this.

The interesting number for gnome-calculator is the FIRST number: how long it takes to be able to use the application from a cold start. 15s is much closer to what I see, EVERY TIME I start gnome-calculator.

That's just... close to unusable.

Daniel van Vugt (vanvugt) wrote :

Last month some of Canonical engineering met up for a regular conference. There a couple of talks were given about what's being done to speed up snap launch times. I was surprised and encouraged there were a couple of efforts in progress. So better performance is coming...

For this particular bug however, we might be in the wrong place. Any improvement in performance would be in some snap* project, not just in the gnome-calculator package. Maybe this bug needs to be moved.

Paul Smith (psmith-gnu) wrote :

It is not physically possible to ever get a snap to start as fast as a native application. The entire purpose of a snap is that it uses its own set of dependencies, which means that by definition it cannot share those dependencies with other applications on the system, which means that they must be loaded separately, which will take longer, use more system resources, etc.

snaps should be used for applications which (a) are difficult to package, and/or (b) want to be used across multiple versions where prerequisites might change, and/or (c) snaps downsides are not as relevant (for example, they are left running for longer periods of time and are large enough that they aren't expected to start quickly, to amortize the increased start time and resource usage).

None of those criteria hold true for a desktop calculator utility. We need to get to the point where I can hit the calculator button on the keyboard and a calculator window appears virtually instantaneously. gnome-calculator was always too slow to start, but now it's far slower: it's moving in exactly the wrong direction. Using it as a way to experiment with snaps just gives both snaps and gnome-calculator a bad reputation.

This bug is not trying to say "we must improve snap startup times".

This bug is trying to say "gnome-calculator is not an appropriate application to be snapped and should be changed back to a native application".

Daniel van Vugt (vanvugt) wrote :

That's a good case for keeping this bug logged here under gnome-calculator. Maybe we should just drop the snap and default to the deb. I'll assign this bug to ubuntu-meta for that...

Although to say something is not physically possible is just inviting people to prove that statement wrong. It is technically true, but misses the main goal of just being fast enough that people don't notice. That is technically possible still.

Paul Smith (psmith-gnu) wrote :

Hey, if my assertion incentivizes someone to figure out how to do that, I'm more than willing to admit I was wrong :).

The thing is, IMO "fast enough" for a desktop calculator is pretty darn fast. In my opinion the current integrated DEB version is already slow enough to be frustrating, so there's plenty of work in this area without even considering the issue of snaps. People just don't expect to have to wait for a calculator on their computer: isn't calculating the thing that computers were built for and are best at?!

I'm not suggesting we should do something like waste users' memory by preloading the calculator app just so it can be ready to display a window quickly, though. In reality probably not enough people use the app often enough to justify that.

Cheers!

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

Other bug subscribers