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 385078 - Optimise e_contact_get
Optimise e_contact_get
Status: RESOLVED FIXED
Product: evolution-data-server
Classification: Platform
Component: Contacts
1.10.x (obsolete)
Other Linux
: High normal
: ---
Assigned To: evolution-addressbook-maintainers
Evolution QA team
Depends on:
Blocks:
 
 
Reported: 2006-12-12 14:56 UTC by Ross Burton
Modified: 2007-04-05 09:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Optimse e_contact_get (10.97 KB, patch)
2006-12-12 16:02 UTC, Ross Burton
committed Details | Review

Description Ross Burton 2006-12-12 14:56:37 UTC
e_contact_get is called *a lot*.  Its called when sorting contacts, when viewing contacts, when doing pretty much anything.

e_contact_get is slow.  Not only does it have to do a linear search but every value is bounced via a GValue.  This is because e_contact_get() simply called g_object_get_property(), which uses GValues.

Attaching a patch so that this is reversed: e_contact_get returns a gpointer, and the get_property() implementation will marshal this into a GValue if required.
Comment 1 Ross Burton 2006-12-12 16:02:55 UTC
Created attachment 78211 [details] [review]
Optimse e_contact_get
Comment 2 Kjartan Maraas 2007-01-25 14:20:04 UTC
Can someone please review this patch?
Comment 3 Ross Burton 2007-04-04 21:13:51 UTC
A review of this would be much appreciated.  It would not only resolve a major difference between eds-dbus and upstream EDS in e-contact.c, but dramatically speed up e_contact_get_*.  Just profile it and you'll see how useful this is.
Comment 4 Matthew Barnes 2007-04-04 23:19:28 UTC
This patch is best viewed through a graphical diff viewer like meld.

It looks like the logic was, for the most part, just swapped between e_contact_get() and the get_property() method.  It looks good to me but I'm not very familiar with EBook yet so I'll defer to Srini for the final say.
Comment 5 Ross Burton 2007-04-05 06:09:34 UTC
Yes, that is what happened.  _get_property now wraps _get, rather than the other way around (which forced a GValue creation/marshal/destroy onto every access).
Comment 6 Srinivasa Ragavan 2007-04-05 07:13:16 UTC
Ross, it looks perfectly fine. You rock !! Commit to HEAD.
Comment 7 Ross Burton 2007-04-05 09:18:22 UTC
Committed, thanks!