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 346670 - Allow backends to send vcards without being matched
Allow backends to send vcards without being matched
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Contacts
1.8.x (obsolete)
Other Linux
: Normal normal
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2006-07-05 16:49 UTC by Ross Burton
Modified: 2013-09-14 16:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (2.67 KB, patch)
2006-07-05 16:50 UTC, Ross Burton
accepted-commit_now Details | Review
Patch to file backend (4.36 KB, patch)
2006-07-06 09:03 UTC, Ross Burton
accepted-commit_now Details | Review

Description Ross Burton 2006-07-05 16:49:59 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.
Comment 1 Ross Burton 2006-07-05 16:50:31 UTC
Created attachment 68417 [details] [review]
Patch
Comment 2 Ross Burton 2006-07-06 09:03:20 UTC
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.
Comment 3 Devashish Sharma 2006-07-07 09:38:17 UTC
Looks good can be committed.
Comment 4 Ross Burton 2006-07-07 10:19:21 UTC
Committed to HEAD, thanks.