GNOME Bugzilla – Bug 751169
Improve search performance
Last modified: 2015-06-18 19:25:37 UTC
The file system model code is doing batched insertion to avoid excessive overhead due to resorting and whatnot, when populating from directories. But search results are inserted one-by-one, with a sorting of the model after each one, despite the fact that we do receive them in batches.
Created attachment 305614 [details] [review] add batched insertion to file system model
Created attachment 305615 [details] [review] use batched insertion
Review of attachment 305615 [details] [review]: Looks good. ::: gtk/gtkfilechooserwidget.c @@ +6129,2 @@ GFile *file; + const char *uri; Both file and uri declarations could go into the for() loop. @@ +6133,3 @@ + for (l = hits; l; l = l->next) + { + uri = (const gchar *)l->data; Minor pet peeve of mine: the cast is not really needed.
Review of attachment 305614 [details] [review]: Looks nice. ::: gtk/gtkfilesystemmodel.c @@ +2139,3 @@ + + gtk_file_system_model_query_done (object, res, data); + gpointer data) I was caught a bit off guard from the thaw_updates() being called after the first query finished; the main loop has to re-enter, in order for this to be called, so effectively the model is thawed after all the queries have started. Maybe a comment would be helpful, but it's not strictly necessary.
freeze/thaw_updates are counting, so the model should be thawed after the last of the batched updates has completed. At least, thats the intention of the code.