GNOME Bugzilla – Bug 346670
Allow backends to send vcards without being matched
Last modified: 2013-09-14 16:49:30 UTC
Sometimes the backend knows for sure that the contact it has found will be in the book view: for example if the filter was "all contacts" or the BDB backend has done a summary search. In this case calling e_data_book_view_notify_contact() is wasteful as it matches the contact against the search expression, which doesn't need to happen. Attaching a patch to add e_data_book_view_notify_update_prefiltered_vcard(), which directly passes a vcard string to the view. This removes both a EContact construction and the matching (its the construction that hurts performance). Once this is in I have a patch for the file backend to use it, which dramatically improves performance for many queries.
Created attachment 68417 [details] [review] Patch
Created attachment 68451 [details] [review] Patch to file backend This patch depends on the first patch being applied, and does two things: 1) use the prefiltered function when possible to avoid vcard->econtact->vcard conversion and redundant matching. 2) tell libdb to use the GLib (non-aborting on no memory) allocators so that every vcarad doesn't need to be copied. This removes a strdup for every contact retrieved. This patch makes the bdb backend faster and leaner.
Looks good can be committed.
Committed to HEAD, thanks.