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 704912 - Cache search result display actors
Cache search result display actors
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: search
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2013-07-26 04:23 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2013-10-30 17:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
overviewControls: Show the workspace thumbails when dragging search results (866 bytes, patch)
2013-07-26 04:23 UTC, Jasper St. Pierre (not reading bugmail)
reviewed Details | Review
search: Actually crash when seeing errors from a native search provider (1.83 KB, patch)
2013-07-26 04:23 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
appDisplay: Use a proper string key for the app search provider (4.90 KB, patch)
2013-07-26 04:24 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
searchDisplay: Remove dead code (1013 bytes, patch)
2013-07-26 04:24 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
searchDisplay: Make the search result actors stateless, by removing terms (5.15 KB, patch)
2013-07-26 04:24 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
searchDisplay: Cache result display actors (6.41 KB, patch)
2013-07-26 04:24 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
searchDisplay: Remove dead code (1.03 KB, patch)
2013-07-26 23:17 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review

Description Jasper St. Pierre (not reading bugmail) 2013-07-26 04:23:53 UTC
While investigating search performance, I found that we were constantly
requesting icons from our remote search providers, and that constantly
deserializing search result icons in the main thread and the large amount
of DBus traffic per-character were the source of most of our troubles.

This attempts to cache result display actors when they're first created
so that if we see the same result ID on future searches we don't re-fetch
the actual display results.
Comment 1 Jasper St. Pierre (not reading bugmail) 2013-07-26 04:23:55 UTC
Created attachment 250169 [details] [review]
overviewControls: Show the workspace thumbails when dragging search results

The workspace thumbnails were accidentally hidden.
Comment 2 Jasper St. Pierre (not reading bugmail) 2013-07-26 04:23:58 UTC
Created attachment 250170 [details] [review]
search: Actually crash when seeing errors from a native search provider

We don't implement many of these, and not catching the error lets us
see stack traces and other such information a lot faster.
Comment 3 Jasper St. Pierre (not reading bugmail) 2013-07-26 04:24:01 UTC
Created attachment 250171 [details] [review]
appDisplay: Use a proper string key for the app search provider

Since we're going to be caching results based on the result ID,
we need to return a string-based result ID to cache on.
Comment 4 Jasper St. Pierre (not reading bugmail) 2013-07-26 04:24:05 UTC
Created attachment 250172 [details] [review]
searchDisplay: Remove dead code

The only GridSearchResult left is app results, which is guaranteed
to have a dragActivateResult.
Comment 5 Jasper St. Pierre (not reading bugmail) 2013-07-26 04:24:08 UTC
Created attachment 250173 [details] [review]
searchDisplay: Make the search result actors stateless, by removing terms

We want to cache result actors between searches, so we shouldn't
instantiate them with search-specific info.
Comment 6 Jasper St. Pierre (not reading bugmail) 2013-07-26 04:24:11 UTC
Created attachment 250174 [details] [review]
searchDisplay: Cache result display actors

When we create a result actor, cache it, so it can be used for
subsearches of the same initial. For now, to keep memory usage
and the stage graph relatively clean, don't persist the actors
across searches, but maybe we should do this in the future.

This also means that we don't query getResultMetas for items
that we've seen in the same initial search.
Comment 7 drago01 2013-07-26 07:21:43 UTC
Review of attachment 250169 [details] [review]:

OK.
Comment 8 drago01 2013-07-26 07:23:11 UTC
Review of attachment 250170 [details] [review]:

Tbh I fail to see the point of this ...
Comment 9 Florian Müllner 2013-07-26 09:46:52 UTC
(In reply to comment #1)
> Created an attachment (id=250169) [details] [review]
> overviewControls: Show the workspace thumbails when dragging search results
> 
> The workspace thumbnails were accidentally hidden.

That's not true, it was an intentional change. See bug 686984 (and commit 1db6d15677221e in particular).
Comment 10 Jasper St. Pierre (not reading bugmail) 2013-07-26 18:30:56 UTC
(In reply to comment #8)
> Tbh I fail to see the point of this ...

When hacking on some of these patches, I got an error like:

"A Error has occured in applications: Expected object for 'List', got string"

or something like that. I spent a lot of time grepping for "A Error", before finally trying "occured" and managing to find the source of the error. Having a stack trace would have been a lot more useful out of the gate.
Comment 11 drago01 2013-07-26 18:54:00 UTC
(In reply to comment #10)
> (In reply to comment #8)
> > Tbh I fail to see the point of this ...
> 
> When hacking on some of these patches, I got an error like:
> 
> "A Error has occured in applications: Expected object for 'List', got string"
> 
> or something like that. I spent a lot of time grepping for "A Error", before
> finally trying "occured" and managing to find the source of the error. Having a
> stack trace would have been a lot more useful out of the gate.

Easier for you as a developer sure ... for a user it is just annoying. How often does this happen? Lets not repeat the "widget not on stage" mistake.
Comment 12 drago01 2013-07-26 18:55:12 UTC
Review of attachment 250169 [details] [review]:

Needs design ack first (see Florian's comment).
Comment 13 Jasper St. Pierre (not reading bugmail) 2013-07-26 19:37:01 UTC
(In reply to comment #11)
> Easier for you as a developer sure ... for a user it is just annoying. How
> often does this happen? Lets not repeat the "widget not on stage" mistake.

It happens whenever the search provider code is broken. I'm fine with leaving it out.
Comment 14 Jasper St. Pierre (not reading bugmail) 2013-07-26 23:17:07 UTC
Created attachment 250245 [details] [review]
searchDisplay: Remove dead code

We cannot drag search results to the workspace thumbnails anymore, so
remove the shellWorkspaceLaunch implementation.



OK, then. If it's intentional, then let's clean up some of the leftover code.
Comment 15 Giovanni Campagna 2013-08-16 20:34:46 UTC
Review of attachment 250245 [details] [review]:

You can't still drag to the workspace (on secondary monitors), so the code in workspace.js needs to be updated.
Also appDisplay has shellWorkspaceLaunch too, you probably want to clean up that.
Comment 16 Giovanni Campagna 2013-08-16 20:35:20 UTC
(In reply to comment #15)
> Review of attachment 250245 [details] [review]:
> 
> You can't still drag to the workspace (on secondary monitors), so the code in
> workspace.js needs to be updated.
> Also appDisplay has shellWorkspaceLaunch too, you probably want to clean up
> that.

And I mean you *can* still drag etc.
Comment 17 Allan Day 2013-08-18 14:59:34 UTC
Are you waiting on design for this?
Comment 18 Giovanni Campagna 2013-08-18 15:12:50 UTC
(In reply to comment #17)
> Are you waiting on design for this?

Uhm, I don't think so, the dubious patch was just rejected.
Comment 19 Jasper St. Pierre (not reading bugmail) 2013-08-18 18:45:49 UTC
The dead code removal was something extraneous I noticed; it doesn't really matter for the rest of the series to go in from what I remember.
Comment 20 Giovanni Campagna 2013-09-12 14:11:08 UTC
Review of attachment 250171 [details] [review]:

::: src/shell-app-system.c
@@ +635,3 @@
+    matches = g_slist_prepend (matches, (char *) shell_app_get_id (SHELL_APP (l->data)));
+
+  return g_slist_reverse (matches);

Are you changing memory management here?

Previously the new list would contain the same nodes as the old ones, now it's a different list, so the old ones need to freed separately.
Comment 21 Giovanni Campagna 2013-09-12 14:11:26 UTC
Review of attachment 250173 [details] [review]:

Ok
Comment 22 Giovanni Campagna 2013-09-12 14:13:51 UTC
Review of attachment 250174 [details] [review]:

This looks good, except that it has problems with providers uncapable of generating persistent search ids or meta ids.
This is already a problem, in the sense that if the meta id is not stable, after one minute the results are not activatable any more, but this patch makes it worse by extending the issue to result ids as well.
Comment 23 Jasper St. Pierre (not reading bugmail) 2013-10-30 17:02:00 UTC
Attachment 250171 [details] pushed as 27cac10 - appDisplay: Use a proper string key for the app search provider
Attachment 250173 [details] pushed as 3749b09 - searchDisplay: Make the search result actors stateless, by removing terms
Attachment 250174 [details] pushed as af06b78 - searchDisplay: Cache result display actors