After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 785380 - On systems with slower disks, overview search is unusable
On systems with slower disks, overview search is unusable
Status: RESOLVED OBSOLETE
Product: gnome-shell
Classification: Core
Component: search
3.24.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2017-07-25 00:28 UTC by Bastien Nocera
Modified: 2021-07-05 14:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
remoteSearch: Allow search providers not to auto-start (1.75 KB, patch)
2017-08-24 11:08 UTC, Bastien Nocera
none Details | Review
remoteSearch: Allow search providers not to auto-start (2.28 KB, patch)
2017-09-14 14:56 UTC, Bastien Nocera
none Details | Review
remoteSearch: Allow search providers not to auto-start (2.27 KB, patch)
2017-09-14 15:03 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2017-07-25 00:28:16 UTC
The overview search is close to unusable on systems with slower SSDs or eMMC (and possibly also any spinning disk), as gnome-shell makes D-Bus spawn loads of separate D-Bus services, most of which load nearly the whole of the application in the backend.

Systems which implement similar functionality, or at least Spotlight in iOS and macOS, have the applications feed data into a single database created for the purpose, which is then searched, rather than applications individually providing data.

Ideally, we'd get all this data from Tracker instead of spawning 15 different backends killing the "go to overview" performance on devices such as low powered tablets and convertibles.

Disabling the Search functionality made my Surface 3's "go to overview" functionality usable.
Comment 1 Philip Chimento 2017-07-25 21:32:16 UTC
We ran into this some time ago on Endless, but I thought it was because we were installing dozens and sometimes hundreds of apps with search providers; didn't realize it was a problem on stock gnome-shell.

Our solution, since the problem was mainly with apps' offline content databases, was to instead export only one search provider for all the offline content apps together. You can see the result here: https://github.com/endlessm/eos-knowledge-services/blob/master/search-provider/eks-search-provider.c

Our solution isn't really useful for solving this in GNOME, since it is specific to the offline content stuff. But let me know if I can help think about a better solution. (I don't know anything about Tracker though.)
Comment 2 Bastien Nocera 2017-07-26 11:23:16 UTC
The problem I think is understood. Starting tens of fairly heavy applications in the background when you type a letter in the overview will not work unless you have the fastest of machines and disk.

This is an article about when iOS introduced Spotlight to third-party apps, in iOS 9:
https://arstechnica.com/apple/2015/09/ios-9-thoroughly-reviewed/5/#h3

Here the apps are the ones feeding into a database, which the search screen will consume. There are currently only a few "types" of GNOME-shell search providers:
- ones showing running information (Terminal, Boxes). Those types can stay, we'd just need to make sure that the search provider isn't instantiated when there aren't any running instances
- those where data is static (Characters, Recipes, Settings). The data could be fed into the database at package install time.
- those with dynamic data (Contacts, Notes, Documents) where indexing data needs to be fed from the app to the database. [1]
- those with really dynamic data (Calculator), probably a special case amongst the special cases

The smoothest way to get this fixed would be to:
- Make it possible for search providers to mark themselves as "never launch", fix Terminal and Boxes
- Make it possible for search providers to mark themselves as "disabled by default", make, say, Recipes, Weather, disabled by default
- Add a tracker client to gnome-shell
- Make it possible for a search provider to give a Tracker query instead of launching a D-Bus service, test this with Files for example [2]
- Make it possible to feed data into Tracker, and also remove it, at application install/upgrade time, combined with the app providing the query, test this with Settings, or Characters

At least the first two are low-hanging fruits.

[1]: We'd probably need the concept of background applications to allow those types of apps to update from the network, in the background, when policy allows it. A wider problem.
[2]: Will likely be a bit more complicated with sandboxing
Comment 3 Bastien Nocera 2017-08-24 11:08:44 UTC
Created attachment 358320 [details] [review]
remoteSearch: Allow search providers not to auto-start

This would be used by search providers which only operate on data in the
running instance, such as the terminal's search provider which finds the
shell in the tab matching the search text.
Comment 4 Bastien Nocera 2017-08-24 11:11:33 UTC
(In reply to Bastien Nocera from comment #2)
<snip>
> The smoothest way to get this fixed would be to:
> - Make it possible for search providers to mark themselves as "never
> launch", fix Terminal and Boxes

AutoStart=false with the attached patch. Untested, mind you.

> - Make it possible for search providers to mark themselves as "disabled by
> default", make, say, Recipes, Weather, disabled by default

This is already possible through "DefaultDisabled=true".

> - Add a tracker client to gnome-shell
> - Make it possible for a search provider to give a Tracker query instead of
> launching a D-Bus service, test this with Files for example [2]
> - Make it possible to feed data into Tracker, and also remove it, at
> application install/upgrade time, combined with the app providing the query,
> test this with Settings, or Characters
Comment 5 Florian Müllner 2017-09-14 14:49:17 UTC
Review of attachment 358320 [details] [review]:

::: js/ui/remoteSearch.js
@@ +118,3 @@
             }
 
+            remoteProvider.AutoStart = true;

Style nit: autoStart

@@ +196,3 @@
             proxyInfo = SearchProviderProxyInfo;
 
+        let g_flags = Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES;

The bit where the variable is used is missing from the patch.
Comment 6 Bastien Nocera 2017-09-14 14:56:06 UTC
Created attachment 359793 [details] [review]
remoteSearch: Allow search providers not to auto-start

This would be used by search providers which only operate on data in the
running instance, such as the terminal's search provider which finds the
shell in the tab matching the search text.
Comment 7 Bastien Nocera 2017-09-14 14:56:50 UTC
(In reply to Florian Müllner from comment #5)
> Review of attachment 358320 [details] [review] [review]:
> 
> ::: js/ui/remoteSearch.js
> @@ +118,3 @@
>              }
>  
> +            remoteProvider.AutoStart = true;
> 
> Style nit: autoStart

Fixed.

> @@ +196,3 @@
>              proxyInfo = SearchProviderProxyInfo;
>  
> +        let g_flags = Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES;
> 
> The bit where the variable is used is missing from the patch.

That's my brain getting confused by the argument also being called that, fixed.
Comment 8 Florian Müllner 2017-09-14 15:01:47 UTC
Review of attachment 359793 [details] [review]:

One style nit left, otherwise looks good to me

::: js/ui/remoteSearch.js
@@ +196,3 @@
             proxyInfo = SearchProviderProxyInfo;
 
+        let g_flags = Gio.DBusProxyFlags.DO_NOT_LOAD_PROPERTIES;

Our coding style uses camelCase for variable names, so 'g_flags' violates that. However there's a good reason to go with that name anyway ...

@@ +207,3 @@
                                          g_interface_info: proxyInfo,
                                          g_interface_name: proxyInfo.name,
+                                         g_flags: g_flags });

... if you take advantage of modern javascript here and replace "g_flags: g_flags" with the synonymous shorthand "g_flags"
Comment 9 Bastien Nocera 2017-09-14 15:03:27 UTC
Created attachment 359794 [details] [review]
remoteSearch: Allow search providers not to auto-start

This would be used by search providers which only operate on data in the
running instance, such as the terminal's search provider which finds the
shell in the tab matching the search text.
Comment 10 Florian Müllner 2017-09-14 15:06:46 UTC
Review of attachment 359794 [details] [review]:

The last review was meant as "fix the comment one way or the other, then push" :-)
Comment 11 Bastien Nocera 2017-09-14 15:09:16 UTC
(In reply to Florian Müllner from comment #8)
<snip>
> ... if you take advantage of modern javascript here and replace "g_flags:
> g_flags" with the synonymous shorthand "g_flags"

I write Javascript like I write C code, so...

(In reply to Florian Müllner from comment #10)
> Review of attachment 359794 [details] [review] [review]:
> 
> The last review was meant as "fix the comment one way or the other, then
> push" :-)

gnome-shell isn't branched though, so should I also do that, or did you want it in 3.26?
Comment 12 Florian Müllner 2017-09-14 16:08:42 UTC
I don't see any harm having it in 3.26 - as long as providers that use the setting don't break when they are autostarted anyway (because they are run on an older gnome-shell version), everything will be fine. And in face of flatpak and friends, not assuming that gnome-shell is at the same version as the application does sound like good advice anyway, so there's little benefit in my opinion in waiting for 3.28.
Comment 13 Bastien Nocera 2017-09-14 16:13:24 UTC
Comment on attachment 359794 [details] [review]
remoteSearch: Allow search providers not to auto-start

Attachment 359794 [details] pushed as 289f982 - remoteSearch: Allow search providers not to auto-start
Comment 14 GNOME Infrastructure Team 2021-07-05 14:08:54 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of  gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/

Thank you for your understanding and your help.