Slingshot is sometimes slow to show up

Bug #1043689 reported by Sergey "Shnatsel" Davidoff
156
This bug affects 38 people
Affects Status Importance Assigned to Milestone
Slingshot
Fix Released
High
Tigran Gabrielyan

Bug Description

Sometimes Slingshot is slow to show up, even while already running.

It seems that Slingshot reads some files every time it's invoked; if the files are cached, all is fine. If they are not cached, it reads them from disk which takes a long time.

This can be reproduced by dropping the page cache by executing "echo 1 > /proc/sys/vm/drop_caches" in a root shell and then opening an already running Slingshot instance.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: slingshot-launcher 0.6+r264-0+pkg12~precise1 [origin: LP-PPA-elementary-os-daily]
ProcVersionSignature: Ubuntu 3.2.0-27.43-generic 3.2.21
Uname: Linux 3.2.0-27-generic x86_64
ApportVersion: 2.0.1-0ubuntu12
Architecture: amd64
CrashDB: slingshot_launcher
Date: Thu Aug 30 12:22:06 2012
ExecutablePath: /usr/bin/slingshot-launcher
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha amd64 (20120303)
ProcEnviron:
 PATH=(custom, no user)
 LANG=ru_RU.UTF-8
 SHELL=/usr/bin/fish
SourcePackage: slingshot-launcher
UpgradeStatus: No upgrade log present (probably fresh install)
XsessionErrors:
 (gnome-settings-daemon:2500): libwacom-WARNING **: Tablet 'usb:056a:0015' has no buttons defined, do something!
 (gnome-settings-daemon:2500): libwacom-WARNING **: Tablet 'usb:056a:0014' has no buttons defined, do something!
 (gnome-settings-daemon:2500): libwacom-WARNING **: Tablet 'usb:056a:0013' has no buttons defined, do something!
 gnome-session[2436]: WARNING: Failed to start app: Unable to start application: Не удалось выполнить процесс-потомок «postler» (Нет такого файла или каталога)

Related branches

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

Strace of file calls shows a lot of stat() which should not be issued on opening Slingshot. Inotify watches should be used instead of polling all those files every time Slingshot is opened.

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

fatrace trace #2 also shows a lot of direct icon access requests. Does that mean that our icon theme cache doesn't work?

Changed in slingshot:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Andrea Basso (voluntatefaber) wrote :

While this bug still remains valid, I've tried with latest revision and the wait is surely more than normal, but still very little, under 1 second on my Core 2 Duo with 2GB of RAM and not-so-fast hard disk.

Changed in slingshot:
importance: High → Medium
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

Well, there were only translation updates since r264 which I tested till the latest r267, so I can't see how could that affect Slingshot performance, especially since the .mo files are not accessed on revealing it at all.

Changed in slingshot:
status: Confirmed → Triaged
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

2,2 seconds on my system that's running from an external HDD.
Don't forget to drop page cache by running "echo 1 > /proc/sys/vm/drop_caches" in a root shell before testing.

Changed in slingshot:
importance: Medium → High
Revision history for this message
Andrea Basso (voluntatefaber) wrote :

Yeah, I dropped the cache, it's just that probably the first time I've tried my system was already slowed down by something else.
I'm not saying this shouldn't be important, indeed if it's not fixed for beta1 it'll surely be for beta2, just that it has medium importante, not high as I previously stated.

Changed in slingshot:
milestone: none → luna-beta2
Changed in slingshot:
importance: High → Medium
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

Here are strace timings for the gmenu3 branch. It still has the same performance issues. I've included timings too (time difference between the beginning and the end of each system call, not CPU time). Slingshot performs a lot of stat() calls but according to the timings, time spent in them is negligible. Weird...

Revision history for this message
Victor Martinez (victored) wrote :

Thanks for the profiling information Sergey!

File accesses during first run are completely normal. Nearly 90% of them are related to icon files. Slingshot (GTK+) usually has to load from 16 to as much as a hundred icons depending on how many applications you've installed. I would rather associate this lag to the drawing internals of the popover widget: The BufferSurface class on which the widget relies for drawing is not fast (and it's not supposed to be, according to the documentation). It is fine for small popovers (say 250x150px), but it gets worse when the popover area becomes bigger.

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

It's not about first run, it's about opening it after it has already started up completely.
I'm sure the lag is linked to the filesystem cache state - if it has the relevant files, Slingshot shows up quickly; if I drop the cache, it takes a while to show up.

Dani Pratomo (daneepee)
Changed in slingshot:
status: Triaged → Confirmed
Changed in slingshot:
status: Confirmed → Triaged
Changed in elementaryos:
status: New → Invalid
Revision history for this message
Cassidy James Blaede (cassidyjames) wrote :

Just a note: I noticed a significant increase in Slingshot's loading time after installing a bunch of random apps (I now have 6 pages). There is definitely a delay between hitting the applications item on WingPanel (or hitting the shortcut) for the first time after logging in and Slingshot opening.

Is there some way to load the other pages after the first one so that the launch is always super fast? It should be nearly instantaneous.

summary: - Slingshot is slow to show up
+ Slingshot is sometimes slow to show up
Revision history for this message
Andrea Basso (voluntatefaber) wrote :

Cassidy, you mean on startup or even after?

Are we really sure there's a problem here? I know little about this kind of things, so I could be missing something obvious, but in my machine (not, when dropping cache, Slingshot take only a little while more than normal and is still a reasonable time. See http://youtu.be/2IilhxUGjC4 for the screencast. Plus, if the filesystem cache is dropped is to free ram to avoid swapping, so are we sure is a great idea to add another cache which doesn't free when asked by the system? I'd prefer a slower Slingshot than a slower system.

Changed in slingshot:
milestone: luna-beta2 → luna-beta3
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

Even after initial startup, each time the user reveals Slingshot it issues... gosh, 38 disk lookups via stat() syscalls! Such amount of random disk reads creates a noticeable delay on HDDs, although it goes unnoticed on e.g. LiveUSBs which have no seek time.

Please find attached a list of directories on which the stat() syscalls are performed. They should be replaced with inotify watches.

Revision history for this message
Tigran Gabrielyan (tigrangab) wrote :

Maybe you're experiencing the slowness that I was. I dont think it's a disk/cache issue.

Try building from source using https://code.launchpad.net/~tigrangab/slingshot/testing-startup-time and see if that has an improvement for you.

Cody Garver (codygarver)
no longer affects: elementaryos
Changed in slingshot:
assignee: nobody → Tigran Gabrielyan (tigrangab)
milestone: 0.3-beta1 → 0.7.3
importance: Medium → High
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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