GNOME Bugzilla – Bug 312690
Optimise book views
Last modified: 2013-09-10 13:41:38 UTC
This is what happens when a book view is executed in EDS: [get vCard from database] contact = e_contact_new_from_vcard(vcard) e_book_view_notify_update (contact) vcard = e_contact_to_string_vcard30 [now send string over IPC] Looks harmless, but if you profile this 68% of the execution time is spend measuring strings, 99.9% of the calls coming from e_contact_to_string_vcard30. This is basically because e_data_book_view_notify_update() takes a EContact, but the database has just retrieved a vCard and the book view needs to send a vCard over the wire. Attached is a prototype patch to e-data-book-view.[ch] and e-book-backend-file.c, which has a non-negligable effect on performance (test creates 300 book views). Before: real 0m12.179s user 0m1.741s sys 0m0.046s After: real 0m3.737s user 0m1.740s sys 0m0.052s Now, this is a prototype patch as this is probably going to be a right pain for some backends to support, where vCards are not the native transport format. Maybe e-data-book-view needs notify_update(EContact*) and notify_update(char*)?
Created attachment 50284 [details] [review] Pass vCards rather than EContacts
Whoops, that patch is against the dbus backend. However, the notify_update() function is identical so the patch might still apply.
looks good... but this would break api freeze.
Created attachment 50447 [details] [review] Improved patch Attaching an improved patch which doesn't leak and doesn't break existing ABI.
adding perf keyword
novell folks: please review this and get this in asap, it blocks several bugs. raising severity; setting target milestone to 1.5. :-/ PS: yeah, everybody hates "asap", me too. ;-)
Assigning it to sushma... sushma: Any comments?
We are testing this patch.
Tested looks good.Can be committed.
Committed to HEAD. Thanks!